07-11-2017, 11:50 PM | #1 |
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
Previewer 3 removing custom font from some headings
My CSS sets <h1> headers to use an embedded font. The file works okay when converted from EPUB to MOBI via Kindlegen in both Kindle for Windows and Kindle Previewer 2.94 (and in EPUB readers), and almost works in Previewer 3.12—except the <h1> tags used for chapter headers display in the default font.
I’ve attached a boiled-down version of my file. Can anyone point me to what I’m doing wrong? |
07-12-2017, 09:07 AM | #2 |
Grand Sorcerer
Posts: 5,611
Karma: 23187563
Join Date: Dec 2010
Device: Kindle PW2
|
This is most likely a Kindle Previewer 3 bug, because when I converted your test file to a KFX file with the Calibre KFX Output plugin, the generated .kfx file displayed fine on my Kindle Paperwhite 2.
|
07-12-2017, 02:21 PM | #3 |
Grand Sorcerer
Posts: 6,571
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
It appears that you have discovered a bug in Kindle Previewer 3. When it converts your test book to KFX format for enhanced typesetting it puts the wrong font family name in the heading style.
Doing some trial and error testing I found that eliminating the "first-line" selector from your stylesheet prevents the problem. It seems to trigger the bug somehow, even though it isn't being used on the problem content. Very strange. |
07-12-2017, 03:50 PM | #4 | |
Grand Sorcerer
Posts: 5,611
Karma: 23187563
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
|
|
07-13-2017, 02:31 PM | #5 | ||
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
Quote:
BTW, how were you able to examine the KFX file? Quote:
Time to talk to the customer about trade-offs. Shame; I was hoping this would be an easy addition, and make the e-books look just that little bit more like the print versions. |
||
07-13-2017, 04:26 PM | #6 |
Grand Sorcerer
Posts: 6,571
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
To pursue this problem a bit more I fed a collection of EPUBs that I keep for testing through the kfxgen app of Previewer 3 and checked the output for the same type of font problem. I found two books that exhibit the same error. One uses the first-line selector, but the other doesn't so the actual trigger for this problem is still not clear.
I have been looking into the workings of KFX since it first appeared and have some hacked together tools for examining content, nothing in a state to be shared at the moment. A little detail on what is going wrong: During conversion to KFX a prefix is added to the names of any fonts embedded in the book. Each book gets a different prefix. (I don't know why, possibly to keep embedded fonts separate from system fonts.) The same prefix is added to the font definition and to each reference to it within the book. Fonts that are called out in the book, but not embedded, do not get a prefix added. In the case of your book the prefix is added to the font definition and to most references, but some references are left unprefixed and so end up calling for a non-existent font. Last edited by jhowell; 07-13-2017 at 04:45 PM. |
07-13-2017, 05:39 PM | #7 | ||
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
Quote:
Quote:
|
||
07-13-2017, 08:13 PM | #8 | ||
Grand Sorcerer
Posts: 6,571
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
Quote:
The conversion of non-DRM KFX content to a readable format has been possible for a while. Amazon published documentation for Ion along with reference implementations in various programming languages. For example, here is the first chapter from the sample you posted converted to KFX by Previewer 3 and then converted to readable Ion text format: Spoiler:
|
||
07-14-2017, 03:44 PM | #9 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Boggles the mind!
(I am giving up and heading for the couch to read a Philip Kerr thriller ... in print!) |
07-14-2017, 04:20 PM | #10 |
Resident Curmudgeon
Posts: 74,669
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I still think that Amazon created KFX for the sole purpose of preventing DRM removal and conversion to other formats like can be done with KF8. Adobe can do all the "enhanced" typesetting with ePub as is. There's no reason Amazon could not have done the same thing with the KF8 renderer.
|
07-15-2017, 11:47 PM | #11 | |
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
Reported as a Previewer bug to Amazon; they say,
Quote:
|
|
07-18-2017, 06:07 PM | #12 |
Grand Sorcerer
Posts: 6,571
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
I looked at the other example and found that it uses a ::after selector in the CSS. Removing that prevents the font problem.
|
01-09-2018, 10:14 AM | #13 | |
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
Fixed!
Quote:
(I meanwhile avoided the bug by including a title page built with SVG, which—for now—disables “enhanced typesetting”.) |
|
01-09-2018, 11:46 AM | #14 | |
Grand Sorcerer
Posts: 6,571
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
I have two other files that continue to have the problem even with the latest Previewer version. So it appears that there is still at least one more variant of the bug remaining. Update: I rechecked the two books that still fail and found that in those cases there are actually missing font files. So it looks like the bug is completely fixed. Last edited by jhowell; 01-09-2018 at 11:57 AM. |
|
Tags |
font embedding, kindle previewer |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Odd font regression in Kindle Previewer, and online | dgatwood | Kindle Formats | 4 | 02-06-2015 01:06 AM |
font-size headings | JLius | ePub | 64 | 04-27-2014 05:38 AM |
Kindle Previewer Font Face grayed out? | katl | Kindle Formats | 7 | 05-01-2013 05:44 PM |
Custom Headings To Catalogue | Quetico | Calibre | 0 | 12-08-2010 11:06 PM |
Different font for headings | bremler | ePub | 4 | 03-11-2010 06:03 AM |