12-22-2018, 09:03 AM | #1 |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
EPUB to AZW3: font sizes changed -- AGAIN!
I had a problem earlier with this earlier (see this thread) which turned out to be due to not having checked "Disable font size rescaling" under Look & feel > Fonts.
Since then I have made this the default, and I spent three days reconverting all my EPUBs with "Use saved conversion settings" unchecked, to make sure that I don't get hit by a book which uses some old settings with font size rescaling enabled. However, I now have another font size rescaling issue. One of my EPUBs (which looks perfectly normal) has <body> tags with no associated CSS. Looking at it with the Calibre editor, the "computed final style" text font size is 18pt (the usual default 1em size), but the converted AZW3 has <body class="calibre">, and the generated "calibre" CSS class contains a line which says "font-size: 12pt". On my Kindle, this is unreadably small, and I have to zoom in to size 11 (on a scale of 1 to 14) before it looks normal, which is size 4 for any other book. I've looked at all the conversion settings and have tried various things to get rid of this (e.g. specifying a CSS rule for <body> with font-size: 1em in the EPUB), but it keeps insisting on generating an AZW3 with a 12pt font size, and the only way I can get rid of it is to manually edit the AZW3 after converting. I've only found this one book with this problem so far, but I have no idea how many others might be affected... Has anyone got any idea why this might be happening? Last edited by Phssthpok; 12-22-2018 at 09:11 AM. |
12-22-2018, 11:52 AM | #2 |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
I've just found another example. A chapter heading and subheading use these rules in the original EPUB:
Code:
.h2 { font-family: serif; text-align: center; text-indent: 0; margin-top: 3em; margin-left: 0; margin-right: 0; margin-bottom: 3em; font-weight: normal; } .h2a { font-family: serif; font-size: x-large; text-align: center; text-indent: 0; margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 2em; font-weight: bold; } Code:
.h2 { display: block; font-weight: bold; text-align: center; text-indent: 0; margin: 2em 0 1em } .h2a { display: block; font-family: serif; font-size: 17pt; font-weight: bold; line-height: 1.2; text-align: center; text-indent: 0; margin: 0 0 2em } The margins are also changed in the main heading from 3em top and bottom to 2em top and 1em bottom. It seems that all font sizes are being expressed in points, and 1em is being treated as equivalent to 12pt, and Kindle points are nothing like 1/72in. And it's also got its own ideas about what margins I should be allowed to have. Last edited by Phssthpok; 12-22-2018 at 12:01 PM. |
Advert | |
|
12-22-2018, 12:11 PM | #3 |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
As a sanity check, I converted again but with font size scaling enabled. (I disabled it earlier because my chapter headings were being shrunk). Suddenly all the generated font-size rules are expressed in ems instead of points, and it looks sensible again.
So it would seem that there is no way to get the font sizes in the EPUB accurately translated to the AZW3 -- either I end up with sizes in ems translated into incorrect sizes in points, or I let it change font sizes in ems into different font sizes in ems. Apart from which, it also changes my margins, whether I use font size rescaling or not. It looks like I'll have to go for font rescaling, and waste another three days reconverting everything, unless someone can suggest an alternative... Last edited by Phssthpok; 12-22-2018 at 12:20 PM. |
12-22-2018, 12:29 PM | #4 | |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
Quote:
I always have "Disable Font Size Rescaling" checked in my Calibre "Common Options" dialog. The font sizes always emerge as em units--never pts or anything else. There may be some other issue at work here. |
|
12-22-2018, 01:57 PM | #5 | |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
As a kindness, could you please try creating a couple of <h2>s using the EPUB CSS I posted above and convert it, and see whether the resulting CSS comes out anything like mine? |
|
Advert | |
|
12-22-2018, 03:35 PM | #6 | |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
Quote:
That is unexpected behavior to say the least. CSS keywords are meant to be translated at the user agent level, not in the stylesheet. [This brings up a related issue: I have found that the Kindle PaperWhite does not handle CSS font-size keywords well. If your device font settings are not the default, the Kindle will display fonts at uncomfortably extreme sizes. I have created a Calibre regex-function which maps keywords to ems. I will post this in the Editor section.] Last edited by Brett Merkey; 12-22-2018 at 04:39 PM. |
|
12-22-2018, 10:05 PM | #7 |
creator of calibre
Posts: 44,015
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
12-23-2018, 01:55 AM | #8 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
a 2 step work around to be going on with
1. calibre epub to epub conversion will replace the font size large, Xx large etc styles with sensible numbers... in Ems 2. then converting that output epub to azw should work well. ( everything i have used this workflow on, then placed on my Kindle PW3 has looked ok I do step one will all newly added books,. arguably it is overkill but it clears out many glitches and annoyances before I even see them, and the output file CSS is easier to understand than some horrible publisher versions. It also, with my additional settings, gets rid of any embedded fonts and simplifies font styles, and standardizes justification to what I want for reading fiction |
12-23-2018, 04:35 AM | #9 |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
@Phssthpok,
If Calibre routinely alters CSS font-size keywords during conversion, this could explain both the readability issues in the conversion result and the fact, as you report, that only some books have the problem. I did not notice this Calibre behavior before you brought the issue up because I always convert those CSS keywords to ems in the epub *before* conversion to AZW3. I recommend avoiding this Calibre issue by using regex to blast away those CSS keywords in the epub. I posted my own workflow solution in the Editor section of this forum. This will allow you to maintain a more fluid control of typography. The translation of keywords to point units for a screen medium does not make much sense and should be avoided. Last edited by Brett Merkey; 12-23-2018 at 04:39 AM. |
12-23-2018, 07:07 AM | #10 | |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
Done that, and problem was reproduced by Brett (to whom my thanks). Last edited by Phssthpok; 12-23-2018 at 07:14 AM. |
|
12-23-2018, 07:09 AM | #11 | |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
|
|
12-23-2018, 07:13 AM | #12 | |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
I'm intrigued by the fact that it outputs ems with font rescaling turned on -- I presume the rescalingis done in ems, even though the rescaly wizard is in points. And I still don't like the way it decides that it doesn't approve of my margin settings and changes them. |
|
12-23-2018, 07:45 AM | #13 | |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
@Phssthpok,
Quote:
Relative units like ems and %, in the long run, offer better solutions for screen devices. Last edited by Brett Merkey; 12-23-2018 at 07:50 AM. |
|
12-24-2018, 08:38 AM | #14 | |
Age improves with wine.
Posts: 559
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
|
|
12-24-2018, 09:55 AM | #15 | |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
Quote:
Last edited by Brett Merkey; 12-24-2018 at 10:01 AM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
EPUB to AZW3: font sizes changed | Phssthpok | Conversion | 3 | 11-29-2018 11:42 AM |
KV font sizes | ladykayaker | Amazon Kindle | 13 | 04-04-2017 11:03 PM |
Font size changes when using rem (azw3 to epub) | patrik | Conversion | 10 | 02-18-2017 06:08 PM |
Epub->AZW3 --- embedded font display is wonky | GrannyGrump | Conversion | 2 | 08-25-2015 06:54 AM |
Only five font sizes in K2? | KlondikeGeoff | Amazon Kindle | 6 | 02-25-2009 10:21 PM |