Mobileread
Mysterious font information in AZW3 file
#1  salty-horse 08-15-2022, 03:19 PM
Reading a recently-purchased Kindle file in the Kindle app in KFX format, I see that "computer text" sections in the book are styled with "font-family: monospace".

When I ask the Kindle software for the ebook in AZW3 format, those text sections are not monospace, but in the CSS file, the style definition for it contains a font name.

Looking at a copy of the physical book, I see it uses this font for those sections.

What's going on here? I assumed the KFX format is the "best" one provided by Amazon, as it includes embedded fonts. Why doesn't it include the actual fonts that the AZW3 file hints at?

Is it a quirk of this particular ebook, something the ebook creation software left in? Or is this a case of information loss in the Kindle publishing system when it converts between formats?
Reply 

#2  JSWolf 08-15-2022, 03:23 PM
When I see font names in the CSS that are not embedded, I change the code to use the same sort of font type when possible.

For serif, I just delete the line as I use serif anyway.
For sans serif, I use font-family: sans-serif;
For monospace, I use font-family: monospace;
For some other type, what I use depends on the font and what it's used for.
Reply 

#3  salty-horse 08-15-2022, 03:25 PM
I added the relevant font to the file, myself. Looks much better now, just like the print edition.

But where are those commented font names coming from?
Reply 

#4  Quoth 08-15-2022, 03:40 PM
AZW3 / KF8 also can have embedded fonts. Download for USB transfer to to get that instead of KFX.
You do have to go to Aa menu and select Publisher.

if the fonts are declared properly you'll get some sort of built-in monospace, even with mobi-KF7 format or azw3/KF8 without any embedded monospace.

KFX uses different rendering and more DRM. I'd not call it the best Amazon format.

Even big publishers often code / format ebooks badly, using inept people with very expensive packages, whereas free Calibre or Sigil from a properly formatted MS Word (or LO Writer via extra docx Save As) can produce a near perfect epub for upload to Amazon. Amazon then convert that to at least 3 formats and send the one they think is appropriate.
Reply 

#5  Quoth 08-15-2022, 03:58 PM
Quote
But where are those commented font names coming from?
The file should start (but doesn't always) as an MS Word or LO Writer document with Paragraph Styles (translate to <p class="whatever-head" ...> or <hn class="whatever-body"> where n is the heading level.
Then the CSS has .whatever-etc{ ... } where ... is the font name, size, style, paddings, margin etc in the original Word docx paragraph, heading or character styles. Character styles become <span class="somecharstyle" etc>text</span> in a <p> paragraph </p>
Naked tags will use outer <div> or <body> styles.
CSS = Cascading Style Sheets
Reply 

#6  jhowell 08-15-2022, 05:45 PM
I have seen books that call for a font that is not actually present either because the publisher failed to include it or because Amazon stripped it out.

Also KF8 and KFX deal differently with embedded fonts. In KF8 you usually need to choose the Publisher Font option in the Aa menu in order to see them.

It would be helpful to know the ASIN of the book in order to be able to research this issue.
Reply 

#7  salty-horse 08-15-2022, 06:03 PM
The book is Planetfall by Emma Newman, ASIN B00SI0B65W
A physical copy can be borrowed on the Internet Archive.

The "computer text" is on the first chapter. Search for "come to the west gate".

I'm using the Kindle app for Android and I don't see a "Publisher Font" option.

The AZW3 CSS looks like this:
Code
p.x06-Text-Message { /*"Briem Akademi Std"*/ font-size:0.83em; margin: 1.82em 10%; text-indent:0;
}
Reply 

#8  jhowell 08-15-2022, 08:19 PM
Thanks for sharing the ASIN. There is something strange going on with that book.

Usually KF8 format is closest to what the publisher originally provided and KFX format is derived from the same source. That does not seem to be the case here.

For this book KFX contains formatting elements that are not present or are broken in the KF8 version. I have never seen this before and I don't know how it could happen. My best guess is that the publisher (Penguin) provided the book to Amazon in an unusual format (perhaps Adobe InDesign) that was then converted to both KF8 (badly) and KFX (better) by Amazon.
Reply 

#9  JSWolf 08-15-2022, 08:35 PM
Quote salty-horse
The book is Planetfall by Emma Newman, ASIN B00SI0B65W
A physical copy can be borrowed on the Internet Archive.

The "computer text" is on the first chapter. Search for "come to the west gate".

I'm using the Kindle app for Android and I don't see a "Publisher Font" option.

The AZW3 CSS looks like this:
Code
p.x06-Text-Message { /*"Briem Akademi Std"*/ font-size:0.83em; margin: 1.82em 10%; text-indent:0;
}
Here is the same CSS class from the ePub version.
Code
p.x06-Text-Message { font-family: monospace; /*"Briem Akademi Std"*/ font-size: 0.83em; margin: 1.82em 10%; text-indent: 0;
}
As you can see, font-family is there. The font name is the font used in the pBook.
Reply 

#10  JSWolf 08-15-2022, 08:36 PM
Would it be OK to post the CSS from the ePub version or would that not be allowed?
Reply 

  Next »  Last »  (1/8)
Today's Posts | Search this Thread | Login | Register