Open editor
Home › Why PDF fonts change

Why PDF fonts change when you edit

You change one word and the whole line looks wrong. Here is the mechanism behind it, and what an editor has to do to avoid it.

Open the editor

Fonts live inside the file

When a PDF is created, the fonts it uses are normally embedded — the actual font program is copied into the document so it displays identically on a machine that has never had that typeface installed. It is one of the format's genuinely good ideas and the reason PDFs look the same everywhere.

Subsetting is where the trouble starts

Embedding a whole font would bloat every file, so producers embed a subset: only the glyphs the document actually uses. A one-page invoice might carry thirty glyphs out of several hundred. You can spot it in the font name — a prefix like ABCDEF+Helvetica means a subset.

This is fine until someone edits the file. Type a character the document never used and there is simply no glyph for it. The editor either draws nothing, draws a wrong shape, or substitutes a different font for the whole line.

What a careless editor does

The easy path is to ignore the embedded font entirely and draw everything in one of the fourteen fonts built into the PDF format — Helvetica, Times or Courier. It always works, never errors, and always looks wrong next to the untouched lines. This is why edited PDFs so often have one line that stands out.

What a careful editor does

  1. Extract the embedded font program from the file.
  2. Use it for the on-screen preview, so what you see matches what you will get.
  3. Check that every character you typed has a glyph in it.
  4. Re-embed it when saving, so the edited line uses the same typeface as its neighbours.
  5. Fall back only when it must — and say which character forced the fallback.

A detail that trips up implementations: in many subsets the space character has no glyph at all, because the producer moved the drawing position along instead of drawing a space. An editor that asks the font how wide a space is gets a meaningless answer. The width has to be worked out from the document itself — the leftover between a line's real width and the sum of its word widths is exactly the space advance. Get this wrong and every edited line comes out with visibly wrong word spacing.

What you can do

Non-Latin scripts

The fourteen built-in PDF fonts cover Latin characters only. Devanagari, Tamil, Bengali, Arabic, Chinese, Japanese and Korean cannot be written with them at all — the characters simply cannot be encoded. For those, embedding a real font file is not an optimisation, it is the only way the text can exist in the document.

Questions

What does ABCDEF+Arial mean in a font name?

The six-letter prefix marks a subset. Only the glyphs the document used were embedded, which is why typing a new character can force a font substitution.

Why does my edited text look slightly wider or narrower?

A substituted font has different letter widths from the original. Matching the exact typeface is the only way to reproduce the spacing precisely.

Can I embed a font I bought?

Technically yes, and this editor lets you load any .ttf or .otf. Whether you are licensed to embed it is a matter for the font licence, and many permit document embedding.

Why can I not type Hindi into a PDF with a standard font?

The built-in PDF fonts have no Devanagari glyphs and their encodings cannot represent those characters. A font that contains the script has to be embedded.

Start editing

The editor opens instantly and runs on your own machine. Nothing is uploaded, and there is no account to create.

Open the editor