Pretext is a text preparation and line-layout engine for any SkiaSharp-based UI that needs deterministic wrapping and visibility rules without delegating everything to a control-specific text stack.
Pretext is built around one idea: expensive text analysis should happen once, and width-dependent layout should be cheap and repeatable after that.
The normal workflow is:
Prepare or PrepareWithSegments.| Item | Use it when |
|---|---|
Pretext |
You want the reusable layout engine in any SkiaSharp-based UI, under the Pretext namespace. |
Pretext.Uno |
You want Uno-specific controls and layout helpers layered on top of Pretext. |
src/Pretext |
You are working on the core package source in this repository. |
src/Pretext.Uno |
You are working on the Uno companion package source in this repository. |
tests/Pretext.Uno.Tests |
You want the deterministic behavior checks and supported-text examples. |
samples/PretextSamples |
You want a reference Uno app that shows the library in real layouts. |
| API | Use it when |
|---|---|
Prepare |
You only need aggregate layout metrics and do not need segment data or line text. |
PrepareWithSegments |
You need segment metadata, materialized lines, or streamed iteration. |
Layout |
You only need line count and total height. |
LayoutWithLines |
You need the rendered line text and widths for each line. |
LayoutNextLine |
You are flowing one line at a time into a custom container, obstacle map, or multi-column algorithm. |
WalkLineRanges |
You need line widths and cursors but want to avoid allocating line strings. |
PreWrap