pdf/src/font.rs#
Source: lib/pdf/src/font.rs
font -- TrueType / OpenType fonts for a document: their metrics, the glyphs a document uses,
and what goes into the file: a Type0 font with Identity-H encoding over a CIDFont whose CIDs
are the font's glyph ids, a subset of the font program (TrueType: unused glyphs emptied in
glyf; CFF: unused charstrings replaced by endchar, cff.rs), the widths (W) and a ToUnicode
CMap for search and copy.
Glyph ids stay as they are (CIDToGIDMap /Identity), so nothing in the content stream depends on
which glyphs the document uses; the emptied entries of glyf, loca and hmtx compress to
almost nothing.
struct FontMetricsthe vertical metrics of a font in its own units (Document::font_metrics)units_per_em: u16ascent: i16-- above the baseline (positive)descent: i16-- below the baseline (negative)line_gap: i16cap_height: i16x_height: i16glyphs: u16-- how many glyphs the font has