Pretext is a deterministic text preparation and line-layout engine for any SkiaSharp-based UI. It prepares text once, exposes segment and break metadata, and lets you compute line counts, materialized lines, or streamed line geometry without relying on control reflow.
`Prepare` and `PrepareWithSegments` precompute widths, break opportunities, and whitespace behavior so repeated layout passes stay cheap.
Use `Layout` for quick metrics, `LayoutWithLines` for materialized lines, or `LayoutNextLine` and `WalkLineRanges` for incremental custom layout engines.
The engine handles grapheme-aware breaks, discretionary hyphens, tabs, preserved whitespace, bidi text, and locale-aware segmentation on desktop targets.
Pretext is a layout engine, not a text renderer. It answers questions such as:
You still own:
Install the packages, learn the font string contract, and build the first useful `Prepare` + `Layout` flow.
Open sectionUnderstand the prepared-text lifecycle, whitespace modes, break kinds, locale-aware segmentation, bidi, and line fitting.
Open sectionIntegrate `Pretext` into Uno or any SkiaSharp-based host, and reuse the sample app patterns for shrinkwrap, editorial, and obstacle-aware layouts.
Open sectionBrowse every public type and operation, the `Pretext.Uno` companion helpers, platform notes, and repository structure.
Open section| Path | Purpose |
|---|---|
src/Pretext |
The packable library project containing PretextLayout and the text preparation/layout pipeline. |
src/Pretext.Uno |
The source for the Pretext.Uno package, with Uno-specific reusable controls and layout helpers. |
tests/Pretext.Uno.Tests |
Deterministic parity tests for whitespace handling, break behavior, bidi text, and line walking. |
samples/PretextSamples |
A Uno sample app with layout demos including bubbles, masonry, editorial, and justification views. |
| Package | Purpose |
|---|---|
Pretext |
Core SkiaSharp-based text preparation and layout engine. |
Pretext.Uno |
Uno-specific controls and helpers layered on top of Pretext. |