Pretext.Contracts is the backend seam for Pretext. It contains the public interfaces and shared font-string parsing helpers used by first-party backends and custom integrations.
The package exposes:
IPretextTextMeasurerIPretextTextMeasurerFactoryPretextTextMeasurerFactoryAttributePretextFontDescriptorPretextFontParserIPretextTextMeasurerFactory advertises:
NameIsSupportedPriorityCreate(string font)IPretextTextMeasurer is intentionally small: it measures text width for the prepared segments that the core engine hands to it.
The first-party backends all parse the same CSS-like subset:
pxbolditalic or obliqueExamples:
16px Interitalic 16px Georgia700 18px "IBM Plex Sans"PretextFontParser.MapGenericFamily(...) also helps backend authors map system-ui, sans-serif, serif, and monospace to host-specific fallback families.
Backends advertise their factory with an assembly-level PretextTextMeasurerFactoryAttribute. Pretext scans loaded and probeable Pretext*.dll assemblies for those attributes during runtime discovery.