Standard14Widths

Glyph widths for the 14 standard fonts, in 1/1000 em.

These are the metrics Adobe publishes for the base 14 (Helvetica, Times, Courier, Symbol and ZapfDingbats) in its Core AFM set. A viewer has to use them: a PDF that names a standard font carries no widths of its own, so any other numbers reflow the text. Metric-compatible substitutes exist and, by definition of metric-compatible, carry the same values.

Stored as a packed string (one record per glyph: "glyphname=width;") to avoid a multi-thousand-line static initialiser that bogs down the Kotlin compiler. Parsed lazily on first use of each font; result cached.

Functions

Link copied to clipboard
fun isStandard14(baseFontName: String): Boolean

True iff baseFontName is one of the 14 names a PDF reader must support.

Link copied to clipboard
fun widthOf(baseFontName: String, glyphName: String): Int?

Width (1/1000 em) of glyphName in baseFontName, or null if unknown.