The repository has these main parts:
| Path | Role |
|---|---|
src/Pretext.Contracts |
Packable contract library for backend implementations |
src/Pretext |
Packable library with the preparation, measurement, bidi, and layout pipeline |
src/Pretext.Layout |
Packable platform-neutral wrap and obstacle-layout helper library |
src/Pretext.DirectWrite |
Packable Windows DirectWrite measurement backend |
src/Pretext.FreeType |
Packable Linux FreeType + Fontconfig measurement backend |
src/Pretext.CoreText |
Packable macOS CoreText measurement backend |
src/Pretext.SkiaSharp |
Packable SkiaSharp measurement backend |
src/Pretext.Uno |
Uno companion library with reusable host controls and render scheduling helpers |
tests/Pretext.Uno.Tests |
Deterministic tests covering segmentation, wrapping, pre-wrap behavior, bidi, and line walking |
samples/PretextSamples.Shared |
Shared sample catalog, assets, and data/model layer reused by the sample hosts |
samples/PretextSamples.Uno |
Uno sample host that exercises the library in visually different layouts |
samples/PretextSamples.MacOS |
Native AppKit sample host that binds Pretext to CoreText |
Pretext publishes the core engine from src/Pretext and exposes the Pretext namespace.Pretext.Contracts publishes the public contracts for custom measurement backends.Pretext.Layout publishes the platform-neutral helper layer built on top of Pretext.Pretext.DirectWrite publishes the first-party Windows-native backend.Pretext.FreeType publishes the first-party Linux-native backend.Pretext.CoreText publishes the first-party macOS-native backend.Pretext.SkiaSharp publishes the first-party SkiaSharp backend.Pretext.Uno publishes the Uno-specific controls from src/Pretext.Uno.At a high level the library does this:
That split is why Prepare is important: it separates expensive setup from repeated layout probes.
Pretext is responsible for:
SegmentBreakKindPretext.Contracts is responsible for:
First-party backend packages are responsible for:
Pretext.Contracts interfacesYour host UI is responsible for:
This architecture gives you deterministic behavior across host controls:
Pretext.Layout without taking a dependency on Uno Platform