sparkles:font
sparkles:font reads OpenType and TrueType font files in D. It opens a face or a collection over bytes the caller owns, finds its tables, reads the fixed-layout tables as plain structs, maps characters to glyphs, decodes name records and names glyphs. Every read stays inside the caller's buffer, malformed data comes back as a FontError rather than an assertion, and no operation allocates.
This is milestone M1 of the font specification: parsing. Variation, metrics, outlines, shaping, rasterization and discovery are later milestones of the delivery plan. Unicode semantics come from sparkles:base; the library links no C library.
Documentation
- Tutorial: open a face and map text
- How-to: inspect a damaged font
- Reference: modules, operations and errors
- Explanation: borrowing, checking once, and leniency
The operation-level contracts are in parsing.md, and the testing page describes the oracles that check them, including the HarfBuzz differential suite in sparkles:font-oracle.