What a Font File Says about Itself

Before a program sets text in a font, it often needs to know things only the font file can tell it: how tall its capitals stand, where its underline goes, how many letters it holds, and whether its maker allows it to be copied into a document. Here three font files are read, and each is set once in its own letters with everything it states about itself underneath. Not one of those figures was typed by hand: each is read out of the file.

The same page measures a line of text written across the page and then down it, finds a letter by its name, and says which alphabets each font claims to cover. At the foot, the first font is added a second time, to write text from top to bottom, and the document states what it does with a font whose maker forbids copying it into a file: it includes it all the same and records a warning.

What This Example Shows

  • Every figure read out of the font file, none typed by hand.
  • A line measured across the page and down it.
  • A stated choice for a font its maker forbids copying into a file.

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.

Read the Rust source Read the Python source

The Document Itself

Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

What a Font File Says about Itself, first page

The Same Document in Other Languages

This document weighs 58.5 kB

Examples Near This One

Breaking an Overlong Word

A word longer than the column that holds it: the library leaves it whole, cuts it at the column's edge, or cuts it and closes the line on a hyphen.

Break Points After a Slash or a Hyphen

A justified column set four times: file paths and compounds running past the edge with no break points, wrapping where a break after a slash or a hyphen is allowed, then wherever their punctuation allows one, and last with no-break hyphens that keep each compound whole.

A Stack Laid out by Hand, One Box at a Time

A delivery slip poured into two boxes, the second taking up where the first stopped, and a poster whose picture no box can hold, each box saying what became of the stack in it.

Every example, by subject