A page that carries no font

A font is somebody's property before it is a file, and putting one inside a document you hand to a customer is a question your lawyer will want to answer. It costs weight too, on every single document you produce. There has been a way round both since the beginning of the format: fourteen fonts all reading software has to draw on its own, whether the file brings them or not, and a document that asks for one of them writes a few lines naming it and nothing else.

The saving is not claimed here, it is measured: the same four lines are laid out twice, once this way and once with a font carried inside, and both figures are printed on the page you get. What it costs is printed there too. A file that claims an archiving or accessibility standard may not do this — those standards want every font carried, and the library refuses to write such a file — and each of these fonts carries a limited set of characters, so a writing system outside it needs a font the file really brings.

What this example shows

  • Four fonts all reading software draws on its own: Helvetica, Times, Courier and Symbol.
  • No font in the file, and both weights measured by the program.
  • What it costs: 256 characters each, and a carried font for a file that claims an archiving or accessibility standard.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document in English Open the document in French

Examples near this one

A minimal PDF

Two identical pages carrying the bones of an invoice in plain shapes, and not a word of text: a file of a dozen kilobytes, with no font embedded.

Making the file smaller

The same document written twice, plainly and packed, with what each one weighs and what the packing saved.

Fonts embedded in the file

Text set in a font embedded in the file, cut down to the letters actually used, and still searchable, copyable and readable aloud.

Every example, by subject