![]() |
#1 |
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: Apr 2009
Location: Champaign, IL
Device: Sony PRS-500, PRS-505, PRS-650, Kobo H2O, H2Ov2, Libra H2O
|
ereader font options vs ebook stylesheet
With most of my ebooks, the font settings (i.e. readingFontFamily) in the "kobo ereader.conf" file work and the books look the same. But some ebooks don't. Is it some setting in the ebook's stylesheet that determines when an ebook uses the H2O's settings or use's the ebooks? Is it ebooks that have explictly defined a font family in the stylesheet that overides the H2O's selected font?
|
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
The publisher is able to override the reader's choice of font family and many other settings from the book if they choose to do so. Converting a book to epub with Calibre can also have a similar unfortunate effect due to the CSS 'flattening' that Caibre does.
There are some firmware patches that can help with some settings such as line spacing, but they are not a perfect solution. The only real solution is to edit the book's stylesheet before sideloading the book and remove the publisher's overriding styles. Edit: To better answer the question: There isn't usually one specific setting that you can change in the stylesheet to fix the problem, but for font-family a general procedure that often works is to remove the font-family property from div/p/span elements that are used for the main body of text and add it to the body element instead, and let the div/p/span inherit the property from body. Leave in place the font-family properties for special elements such as headings etc. That way you can see the publisher's original setting by selecting the "Document Default" font, and special elements such as headings will remain in the publisher's font, but selecting a different font from the device will change the main body of text. Edit2: A blunter approach for font-family is simply to strip all font-family styles and all embedded fonts from the book. However that can spoil some books which depend on different font styles as an integral part of the story, e.g. to indicate different speakers; and detract from other books which simply make some nice use of fonts in appropriate places, such as fancy headings or a handwriting font for extracts from a diary. Last edited by GeoffR; 05-14-2015 at 11:09 PM. Reason: o better answer the question ... |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: Apr 2009
Location: Champaign, IL
Device: Sony PRS-500, PRS-505, PRS-650, Kobo H2O, H2Ov2, Libra H2O
|
Thank you for the information. Let me see if I understand correctly:
All of my books are side-loaded epubs (using Calibre) and many of those are Calibre converts. Before I got my H2O I had a sony PRS-650, so I am comfortable using the book editor function in Calibre to fix the formatting (such as adding justification). So looking at a typical book: it will have a body element (often labeled calibre), a .p element and a div element (such as .indent). Do the device settings wrap around everything (and be affected by .css inheritance rules) or replace the .body element? From your explanation it sounds like it replaces the .body element and would then be overridden by the .p and .indent division elements. Again, thanks. Last edited by Shadowjack; 05-15-2015 at 10:12 AM. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
For epubs most of the device settings are set in the body element (using !important). If you have a stylesheet like this:
Code:
body {line-height: 1.5;} p {text-indent: 1em;} But there is a problem with the way that Calibre creates epubs. When Calibre converts a book with the stylesheet above, it creates class for body like: Code:
.calibre {line-height: 1.5;} Code:
<body class="calibre"> What you need to do with Calibre-created/converted books is to remove the settings such as line-height from the .calibre class and specify them directly in body as the first example above. Edit: The above applies to the EPUB reader, which interprets !important differently than the KEPUB reader. Last edited by GeoffR; 05-16-2015 at 04:26 AM. Reason: ... applies to the EPUB reader ... |
![]() |
![]() |
![]() |
#5 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
I use Calibre's style filtering to get rid of most offending styles.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 733
Karma: 5797160
Join Date: Jun 2010
Location: Istanbul
Device: Kobo Libra
|
That could be too destructive, best way is to take a look to the book itself.
|
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Quote:
On the left is an epub with a raisecap, the raisecap span has its line-height set to zero to prevent it affecting the line spacing of the rest of the paragraph. On the right is what happens when that line-height style is removed: |
|
![]() |
![]() |
![]() |
#8 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
In the case that a book has special needs, I also use Search&Replace (or similar tools) to fix things. Don't get me wrong, I'd happily do without any style filtering - and without Calibre conversion which is lossy at best - except very many books are borderline unreadable without this procedure.
![]() |
![]() |
![]() |
![]() |
#9 |
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: Apr 2009
Location: Champaign, IL
Device: Sony PRS-500, PRS-505, PRS-650, Kobo H2O, H2Ov2, Libra H2O
|
I played around with a couple of my converted books and think I have it working so that format changes in the device, show up when reading. One strange thing I ran into is that sometimes a Calibre converted book with have a font-size of 1.29167 for the .calibre class and the main text of the book will then be set .77419 (equivalent to using a font size of 1 for both). Why would it do this? Is there a easy way to set the conversion so that the main text is always 1em?
|
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Quote:
Edit: As to why Calibre does this: I think it must be to cater for ereaders which don't have a way to change the font size from the device. Last edited by GeoffR; 05-17-2015 at 01:07 AM. Reason: ... why Calibre does this ... |
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
If you don't want to disable font size rescaling, have you tried setting the box underneath it, 'Base font size', to 12pt. I'm not sure whether it always works, but if you have it set to anything else I don't believe the resulting body css will ever be 1em.
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Built-in-Light, TTS, good font options - possible? | Shadowplay | Which one should I buy? | 10 | 10-21-2013 04:34 PM |
Aura: font options for side-loaded content? | miquele | Kobo Reader | 4 | 07-05-2013 06:58 PM |
EReader Alternatives/Options | tedwards70 | Kindle Fire | 4 | 11-18-2011 10:43 AM |
What Fonts are used in various eReaders? What Font options are available? | tomereader | General Discussions | 28 | 08-20-2010 05:40 AM |
cyrillic font and all languages options | PJ45 | Sony Reader | 5 | 06-26-2009 09:34 AM |