← toolkit.bot

EPUB Fonts — Embedding, Subsetting, and Licensing for E-Reader Distribution

Custom fonts in EPUBs improve readability and brand consistency, but embedded fonts add file size and raise licensing questions. Here's everything publishers and developers need to know.

How EPUB Fonts Work

EPUB uses standard web font technology. Fonts are embedded as OTF, TTF, or WOFF2 files in the EPUB's Fonts/ folder and referenced via CSS @font-face declarations:

@font-face {
  font-family: "MyFont";
  src: url("../Fonts/MyFont-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "MyFont", Georgia, serif;
}

If the embedded font fails to load (corrupted file, wrong path, or device restriction), the e-reader falls back to the next font in the stack — in this case Georgia, then the system serif.

EPUB 3 Font Support

EPUB 3 supports:

For maximum compatibility, embed OTF or TTF. Convert to WOFF2 for size savings on modern readers that support it.

Font Licensing: What You Can Embed

Not all fonts can be legally embedded in EPUBs. The font's license determines what's allowed:

To check the fsType embedding permission in a font file:

python3 -c "
from fontTools.ttLib import TTFont
f = TTFont('MyFont.otf')
print(f['OS/2'].fsType)
# 0 = installable (freely embeddable)
# 4 = print/preview only
# 8 = editable embedding
"

fsType 0 means freely embeddable. Any other value requires checking the license before distributing in EPUBs.

Font Subsetting to Reduce File Size

Full font files include characters for many languages. Subsetting removes unused glyphs, keeping only the characters actually used in the book. This reduces font file size by 80–95% for Latin-only text.

# Install fonttools
pip install fonttools brotli

# Subset to characters used in an English book
pyftsubset MyFont-Regular.otf   --unicodes="U+0020-007E,U+00A0-00FF,U+2018,U+2019,U+201C,U+201D,U+2026"   --layout-features="kern,liga,calt"   --output-file="MyFont-Regular-subset.otf"

The Unicode ranges cover: ASCII printable (U+0020–007E), Latin-1 Supplement (U+00A0–00FF), curly quotes (U+2018–201D), and ellipsis (U+2026). Add ranges for any special characters in your book.

Font Obfuscation (IDPF Method)

EPUB 3 defines a font obfuscation method to prevent font extraction from EPUBs. This is separate from DRM — it only scrambles the first 1040 bytes of the font file so it can't be extracted and used elsewhere, while e-readers that understand EPUB obfuscation can still render it correctly.

Calibre and Sigil can apply IDPF font obfuscation. In Sigil: Tools → Obfuscate Fonts. The OPF encryption.xml file is updated automatically.

When to Skip Embedded Fonts

For trade fiction and most nonfiction, embedded fonts are optional. Every major e-reader platform (Kindle, Kobo, Apple Books) has excellent system fonts and user-adjustable typography. Consider skipping embedded fonts when:

Embedded fonts are worth including for: poetry (line spacing matters), illustrated books with matching display fonts, textbooks with monospace code blocks, and any EPUB where brand typography is central to the design.

Converting a PDF to EPUB? toolkit.bot generates clean EPUB output ready for font customization.

Convert PDF to EPUB →

Related guides