Gets character widths for a range of characters.
Returns the original font bytes.
Creates a FontDescriptor suitable for embedding. Scales metrics to PDF's 1000-unit em square.
OptionalfontName: stringParses the font and returns basic font information.
Returns true if this is a CFF-based OpenType font.
Parses the font's cmap table to extract Unicode to glyph ID mappings.
A map from Unicode code points to glyph IDs
Parses the font's hmtx table to extract glyph advance widths.
A map from glyph IDs to advance widths (in font units)
Parses OpenType font files (.otf) to extract metrics and glyph widths. Supports both CFF-based and TrueType-based OpenType fonts.
Note: OTF files share the same table structure as TTF for metrics, the main difference is the glyph outline format (CFF vs TrueType).