About

Tool No. 50 of Pikkola

A font file is a small database that designers rarely open. Its family name, its licence, the height of its capitals and the scripts it truly covers are all written inside, in tables with four-letter names. This page opens them in the browser, then puts the numbers to work in a type scale and a paragraph.

What it does

How a file is read

An SFNT file starts with a version, a table count, and then one 16-byte record per table: a four-character tag, a checksum, an offset and a length. Read the offset and the length and you hold that table's bytes. Everything else is decoding: the name table's records say which platform and language each string is for, the OS/2 table keeps the weight class and the typographic metrics, and cmap maps code points to glyph numbers through segments or groups.

A WOFF holds the same tables, each compressed with zlib and given a new offset. The page inflates each one with the browser's DecompressionStream and reads the result exactly as it reads an uncompressed table. A WOFF2 is different in kind: every table goes into a single Brotli stream, and Brotli is not exposed to JavaScript, so no page can open it. What this page does instead is read the 48-byte header and the table directory, which still say the flavour, the table count and the size the file would take uncompressed, and then hand the original bytes to the font engine so the specimen is drawn in the real face.

Coverage, counted honestly

The coverage bars are not claims about quality. For each block (Latin, Latin-1, Greek, Cyrillic, Arabic, Hangul syllables, kana, CJK ideographs, punctuation, symbols, emoji) the page asks the character map for every code point in the block and counts the ones that come back with a glyph other than .notdef. A Latin-only font therefore shows zero for Hangul, and a Korean font that covers the modern syllables fills 11,172 of them.

This is also the quickest way to see what a subset is: a webfont cut down to the characters of one page will show a thin bar exactly where the cut was made. The two samples built into the page demonstrate it, since both are subsets.

The scale, and what clamp() is doing

The type scale is a base size multiplied by a ratio, once per step. For the fluid option each step gets three numbers: the size at the small viewport, the size at the large viewport, and a preferred value that is a straight line between them. That line is written as calc(Arem + Bvw), so the browser can interpolate at any width. The large value is the same step at a base size 15 percent larger, which is a modest growth that keeps a 390-pixel phone readable without making a 1440-pixel screen shout.

Nothing is rounded to whole pixels. A scale that rounds each step to the nearest pixel loses its ratio, and the ratio is the only thing that makes a scale a scale.

What it deliberately does not do

The sample fonts

Two samples ship with the page so the inspector has something to read before you drag a file in. Both are subsets of open-licensed families, renamed as the SIL Open Font License asks of a modified copy, and both stay under that licence: Pikkola Sample Sans is a Latin subset of a variable sans with a weight axis, and Pikkola Sample Hangul is a Hangul, kana and Latin subset of a Korean sans with CFF outlines. They are embedded in the page as base64 and are never fetched.

Why it is free

Pikkola builds small tools that do one job and keeps them free, with no account and no advertising. A static page that does its work in the browser costs almost nothing to serve, so there is no reason to charge for it.

Contact

A font that the parser gets wrong, a table it should read, a sentence in Korean or Japanese that lands badly: hello@pikkola.com. If a file breaks the page, say which font it was, or send the smallest file that shows the problem.

Back to the studio