Standard14Widths

Standard 14 base font widths, ported from the URW++ AFM files MuPDF ships. Metric-compatible with Adobe Helvetica / Times / Courier / Symbol / ZapfDingbats.

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.