12-12-2014, 11:25 AM | #1 |
Resident Curmudgeon
Posts: 76,016
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
How to get font size working in ePub?
I've created a test ePub so I can see different font sizes so I can better customize the font slider to what I prefer. The ePub displays as expected with ADE. But on the Kobo, it is all the same font size. How can I get it to actually display with different font sizes? How can I get the font size slider to stop overriding my styles?
I've attached the ePub in case anyone can help. Thanks. |
12-12-2014, 01:21 PM | #2 |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
There is no way to turn off the font-size slider, it is always set to something, so I think all you can do is set it to a known font size and calculate your pixel font sizes relative to the known base size.
For example, if you set the slider to size 50, then a base font size of 200% will corespond to 100 pixels, and so a paragraph font size of 1% should correspond to a of size of 1px. Code:
<body style="font-size:200%;"> <p style="font-size:10%;">10 pixel font.</p> <p style="font-size:20%;">20 pixel font.</p> Last edited by GeoffR; 12-12-2014 at 01:24 PM. Reason: Assuming slider sizes are in pixels |
Advert | |
|
12-12-2014, 01:32 PM | #3 |
Resident Curmudgeon
Posts: 76,016
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Well, that sucks. There needs to be a way to specify font sizes other then relative to the current font size.
|
12-12-2014, 03:09 PM | #4 |
The Grand Mouse 高貴的老鼠
Posts: 72,252
Karma: 309000000
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
|
12-12-2014, 03:18 PM | #5 | |
Bibliophagist
Posts: 39,751
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
You used to be able to specify absolute font sizes using pixels (px) or points (pt) to specify them. CSS3 redefined those two to proportional as well so when you zoomed a page in your browser, they changed proportionately. Though I have to wonder why you started at 1px -- it's a bit hard to display text when you have 1 pixel to draw the entire character. Last edited by DNSB; 12-12-2014 at 03:24 PM. |
|
Advert | |
|
12-12-2014, 03:20 PM | #6 |
Bibliophagist
Posts: 39,751
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I've owned two ebooks that used pixels to define font size. Looked okay on my original Kobo ereader but too small on my Glo and way too small on my Aura HD.
|
12-12-2014, 03:41 PM | #7 |
Resident Curmudgeon
Posts: 76,016
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But one issue will be pseudo small-caps. A lot of CSS for small caps is specifying a font size of 7em or .8em. Also, I've seen a lot of CSS code that uses .8em instead of small for a font size and if I'm not mistaken, the Kobo will display these CSS styles in the same size as the body font.
|
12-12-2014, 03:46 PM | #8 | |
Resident Curmudgeon
Posts: 76,016
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
The thing is, I cannot get any absolute font size to work. px, em, pt all fail to show a different font size. Kobo has gone too far in overriding the font size. I see a lot of code that uses a p with a style like <p class="chapter"> and in .chapter is a font size of say 1.5em which might not display as 1.5em and thus, the chapter titles will look and be off. |
|
12-12-2014, 04:53 PM | #9 | |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Have you really been editing your Sony epubs in hard-coded px units, like this test epub, all these years? |
|
12-12-2014, 05:12 PM | #10 | |
Resident Curmudgeon
Posts: 76,016
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
I'll give your recommendations a try. Thanks. |
|
12-12-2014, 05:16 PM | #11 | |
The Grand Mouse 高貴的老鼠
Posts: 72,252
Karma: 309000000
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
|
|
12-12-2014, 05:27 PM | #12 | |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Regarding using small, large etc. I'm not sure how this works in a nested hierarchy. I noticed very early in my ereader life that calibre conversions always changed them to ems and I thought Kovid normally takes line-of-least-pain-choices, who am I to argue |
|
12-12-2014, 08:12 PM | #13 | |
No Comment
Posts: 3,240
Karma: 23878043
Join Date: Jan 2012
Location: Australia
Device: Kobo: Not just an eReader, it's an adventure!
|
Quote:
|
|
12-12-2014, 08:40 PM | #14 | |
Resident Curmudgeon
Posts: 76,016
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Try the following and see if it works... CSS Code:
.small { font-size: .7em; } Code:
<p>Some text. <span class="small">SOME MORE TEXT</span>. Even more text.</p> |
|
12-12-2014, 09:04 PM | #15 | |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
BTW I think murg may have meant he uses the <small>...</small> tags rather than the <span class="small">...</span> tags. But both should work exactly the same on the Kobo if the css is Code:
small, .small {font-size: 0.7em} |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CSS not working (specifically bold & font size) | kaonevar | Editor | 10 | 10-10-2014 12:47 AM |
Epub > Epub conversion changes font size.. why? | OllieDixon | Conversion | 2 | 03-31-2014 02:30 AM |
Determine font and font size on incoming epub? | peaceridge | Calibre | 4 | 01-30-2012 03:35 PM |
More on working around the font-size issue | billingd | Kobo Reader | 13 | 06-25-2010 08:49 PM |
Base Font Size not Working | Colaveare | Calibre | 0 | 05-06-2009 02:09 AM |