Readwyn 0.1.0

Why does this ebook ignore my font setting?

You pick a new font on your Kobo, open a novel, and the text stays in the publisher's typeface, or the headings change while the paragraphs don't. The book's own stylesheet is the first place to look. If it names a font on the paragraphs themselves, your font setting is only a default for the text where the book names nothing. A "publisher font" option that's still switched on has the same effect. A related puzzle, the same book looking different from one app to the next, can come from an embedded font that one app can decode and another can't.

Why a rule on a paragraph wins

An EPUB is a bundle of web pages styled with CSS. If a reading app sets your font once, at the top of the document, the paragraphs inherit it. Under the CSS rules, a paragraph inherits a font only if the book's stylesheet gives it none. If the stylesheet says p { font-family: "Minion Pro" }, every paragraph keeps Minion whatever you pick. The same specification ranks the book's normal rules above the reader's; to beat them, an app has to mark its own rule !important or rewrite the book's CSS.

Amazon asks publishers not to do this. Its KDP text guidelines want the main font set at the <body> level and say "Body text should not have a forced font face", warning that readers may otherwise lose the choice. When Amazon processes a book, it moves the font family used in most of the content up to the root tag, and if fonts conflict with the reader's override, it strips the font files out.

The publisher font switch

Many apps have a setting that hands the choice back to the book. Amazon's Kindle Paperwhite guide from 2012 already listed a Publisher Font option in the Aa menu, shown only on books that embed fonts, and the KDP page says readers on KF8 devices and apps can turn publisher fonts on or off. Kobo's Web Reader puts a "Publisher default" toggle under Advanced Settings (Kobo help).

At Apple, the publisher sets the switch inside the book. The Apple Books Asset Guide tells publishers that any book with embedded fonts must define ibooks:specified-fonts, and its example sets it to true. A reader can still choose another font, and can always switch back to the book's original ones.

What to try

  1. Pick a named font instead of the publisher option. On a Kobo that's the Font Face dropdown of the Text menu (Kobo help), where a font you added yourself also appears. Kobo's help also warns that its OpenDyslexic font may not work in some ebooks or languages.
  2. If only some text changes, the stylesheet sets a font on the text that stays the same. In KOReader, turn off Embedded style and Embedded fonts: its user guide calls them on/off switches for the publisher's styles and fonts, with Style Tweaks for finer control.
  3. If the book is a DRM-free file of your own, open its CSS, delete the font-family lines on p and on paragraph classes, and keep one on body.

Readwyn's reader takes only a short list of rules from a book's CSS (alignment, indents, margins, italic and bold, small caps, relative size, vertical alignment, and hidden elements). A font family isn't on that list, so the font picked in its Text panel sets the text of every book.

Fonts that won't decode

Some publishers obfuscate an embedded font so it can't be copied out by unzipping the EPUB. The EPUB 3.3 specification defines how: the first 1040 bytes of the font are scrambled with a key, a SHA-1 hash of the book's unique identifier, and the file META-INF/encryption.xml marks the font as scrambled. The reading system specification says apps should undo this but doesn't require it, and the EPUB spec itself warns that such a book may look different from one app to the next. Where the font can't be decoded, the text falls back to another font, which may lack some characters (why ebooks show boxes). Because the key comes from the identifier, changing a book's unique identifier without obfuscating its fonts again leaves them unreadable in every app.