Engineering Guides
Fixing Missing Glyphs & Tofu Boxes: cmap Coverage and CSS Fallbacks
Debug missing glyph tofu boxes (.notdef), audit cmap table coverage before subsetting, keep punctuation intact, and build safe CSS fallback stacks.
Quick Answer
Tofu boxes (□) appear when text requests a Unicode codepoint missing from the active font's cmap table and no fallback font supplies it, forcing the engine to draw glyph 0 (.notdef). Prevent tofu by running your real copy through a Missing-Character checker first, retaining punctuation and currency signs when subsetting, and terminating every CSS font-family stack with dependable system fallbacks.
Why .notdef tofu boxes and fallback font flashes happen
Every OpenType font maps Unicode codepoints to glyph outlines through its cmap table. When a font is over-subsetted—or lacks localized characters like €, ¥, —, ® or CJK Extension B ideographs—text engines fall back to glyph index 0 (.notdef), rendered as an empty rectangle or crossed box.
Even when browsers mask missing glyphs by borrowing from another installed OS font, mismatched stroke weight and baseline metrics create jarring visual flashes mid-sentence.
- Missing smart punctuation: curly quotes (‘ ’ “ ”), em-dashes (—), and non-breaking spaces (U+00A0) stripped during naive subsetting.
- Missing currency & UI symbols: €, ¥, £, ©, ®, ™, and arrows (→) omitted from basic ASCII presets.
- Partial CJK or Latin Extended coverage: rare surnames, accented European characters (ß, ñ, ł, ç), or full-width punctuation missing from cmap.
Safe CSS font-family fallback stacks and subsetting rules
Never ship a bare font-family: 'BrandFont'; declaration without a full fallback chain. Pair your subsetted WOFF2 with a metric-matched fallback face and OS native sans/CJK/symbol fallbacks, and always enable punctuation and digit retention when trimming glyph sets.
:root {
--font-sans: 'InterSubset', 'Inter Fallback', system-ui, -apple-system,
'PingFang SC', 'Hiragino Sans', 'Malgun Gothic', 'Segoe UI', sans-serif;
}
body {
font-family: var(--font-sans);
}Pre-flight cmap and OpenType checks before shipping
Before deploying a trimmed webfont, PDF bundle, or game UI atlas, verify both the Unicode subtable structure and your live copy coverage in browser RAM so zero .notdef rectangles slip into production.
- Confirm cmap format 4 (Basic Multilingual Plane) and format 12 (32-bit supplementary planes) cover your target scripts.
- Verify whether an icon or wordmark uses Private Use Area codepoints (U+E000–U+F8FF) that OS fallback fonts will never supply.
- Test real multi-language strings (prices, dates, user names) in Missing-Character Check before building assets.
Open tool:Audit cmap subtables in Font Inspector →
Frequently asked questions
Why does a missing character show a system font in Chrome but a tofu box in PDFs?
Web browsers scan installed system fallback fonts character by character, whereas PDF renderers, Canvas APIs, and game UI atlases often stay locked to one font and draw its .notdef rectangle.
Which glyphs are dropped most often when subsetting fonts manually?
Em-dashes (—), curly apostrophes (’), non-breaking spaces, currency signs (€, ¥, £), and legal symbols (®, ™) are frequently missed when pasting only sample ASCII prose.
Can I extract only Latin letters, digits, and punctuation from a large CJK font?
Yes. Extract Latin from Font and Font Subsetter retain Basic Latin, Latin-1 Supplement, and common punctuation while trimming tens of thousands of unused ideographs.
Authoritative References
Tools used in this guide
Related formats
Related Comparisons
More engineering guides
- Build a Custom SVG-to-WOFF2 IconFont in Your Browser Without Node CLIBundle monochrome SVG UI icons into a lightweight WOFF2 + TTF IconFont with CSS classes and demo.html locally — zero Node tools or cloud uploads.
- Removing Font Hinting (fpgm/prep/cvt): Saving 8–15% Bytes on Retina ScreensStrip legacy TrueType bytecode hinting tables (fpgm, prep, cvt) with HarfBuzz WASM to save 8%–15% WOFF2 bytes for macOS, iOS, and modern HiDPI screens.
- Subsetting CJK Fonts for Unity TextMeshPro & Godot Game BuildsExtract exact localized glyphs from CSV/JSON game dialogue scripts and subset 18 MB CJK TTFs into lean TextMeshPro and Godot assets locally.