All Articles
Font Engineering & Glyphs9 min read2026-02-08

Troubleshooting Font Embedding in PDFs: CIDFonts, ToUnicode CMaps, and Subsetting Failures

Why do some PDFs copy garbled symbols when you paste their text? Understand font subsetting dictionaries, CID font tables, and ToUnicode mapping.

Pdfyara Standards Lab
Typography & Vector Glyphs Engineer

The Mystery of the Garbled Text: Why Copy-Paste Breaks

Almost every computer user has experienced this annoying phenomenon: you open a PDF document that looks perfectly readable on screen, but when you highlight a sentence and paste it into Microsoft Word or an email, the text transforms into bizarre gibberish, empty square boxes, or random Greek characters.

This problem does not mean the file is corrupted. It is the direct consequence of how digital typography is encoded inside a PDF.

Glyph Indices vs Unicode: The Crucial Role of ToUnicode CMaps

When a word processor renders text, it uses Unicode code points (for example, U+0041 for the capital letter 'A'). However, inside an optimized PDF font subset, the font engine frequently assigns arbitrary internal Glyph Index numbers (e.g., Glyph 1, Glyph 2, Glyph 3) to optimize file size.

If the software created glyphs 1 through 5 for the letters 'H-E-L-L-O', the PDF reader displays them visually according to vector coordinates. But when a user copies the text, the reader must translate Glyph 1 back into Unicode.

This translation requires an embedded ToUnicode CMap table. If the PDF authoring tool failed to embed a valid CMap dictionary, the reader defaults to raw ASCII mapping, resulting in scrambled copy-paste text.

Technical Diagnostic
If you cannot copy-paste text or if search queries return zero matches on visible words, the PDF lacks an embedded ToUnicode CMap table.

The Four Types of PDF Font Embedding

ISO 32000 classifies font inclusions into four distinct states:

Embedding LevelDescriptionProsCons
UnembeddedOnly font names and metrics are specified; host OS must supply fontTiny file size (a few bytes)Layout explodes if recipient machine lacks the font
Fully EmbeddedEntire TrueType or OpenType binary file is stored inside the PDFUniversal layout fidelityHeavily inflates PDF size (adds 5MB - 30MB per font)
Subset Embedded (Recommended)Only glyphs actually used in the document are packaged100% visual fidelity with minimal file size overhead (10-30KB)Cannot easily add new characters later without original font
Outlined / FlattenedLetter glyphs are converted to raw vector Bézier curve outlinesImpossible for fonts to break on any device or pressText is no longer searchable, editable, or selectable

How to Repair Font Issues in Problematic Files

If you receive a PDF with missing font errors or defective printing, two reliable remediation methods exist: 1) Run the document through an OCR engine to re-index an authentic Unicode text layer, or 2) Flatten annotations and vector curves using Pdfyara's Flatten PDF tool before sending to production printing.

P
Pdfyara Standards Lab
Document Engineering & Standards Lab • Pdfyara
Peer-reviewed for ISO 32000 technical accuracy
Back to Engineering BlogPublished on 2026-02-08