Skip to main content

Module font_loader

Module font_loader 

Source
Expand description

Font loading pipeline.

Loads Type 1 font files from disk, parses them, and creates PostScript font dictionary objects. Includes font name substitution table.

Constants§

FONT_SUBSTITUTIONS
Standard PostScript font name → URW replacement filename.

Functions§

find_font
Try to find a font by name: check FontDirectory first, then load from disk.
find_substitution
Look up a font substitution: “Helvetica” → “NimbusSans-Regular”.
load_font_file
Try to load a font by name, using the substitution table. Checks embedded files first (for WASM), then falls back to disk.
load_type1_font
Load a Type 1 font from data and register it as a PostScript dict in the context. Returns the font dict PsObject.