For Uno applications, Pretext.Uno is now the convenience package. It brings the core engine, Pretext.Layout, and the first-party backend set transitively.
The common integration pattern is:
MeasureOverrideprivate PreparedTextWithSegments? _prepared;
void UpdateText(string text, string font)
{
_prepared = PretextLayout.PrepareWithSegments(text, font);
}
Size MeasureBubble(double maxWidth, double lineHeight, Thickness padding)
{
if (_prepared is null)
{
return Size.Empty;
}
var layout = PretextLayout.Layout(_prepared, maxWidth, lineHeight);
return new Size(maxWidth + padding.Left + padding.Right, layout.Height + padding.Top + padding.Bottom);
}
The companion packages in this repository add reusable helpers around the core engine:
StretchScrollHost for page-like scrollable samples and viewport calculationsUiRenderScheduler for coalesced redraw scheduling on DispatcherQueuePreparedTextMetrics for wrap metrics and tight-width calculationsColumnFlowLayout and ObstacleLayoutHelper for flowing lines into constrained regionsStretchScrollHost and UiRenderScheduler live in Pretext.Uno. The layout helpers now live in Pretext.Layout, which Pretext.Uno brings transitively for Uno apps. Use them when they match your layout model, but keep the core Pretext API as the main dependency.
If you want the current Uno integration pattern rather than older experiments, start with:
samples/PretextSamples.Uno/MainPage.xaml.cssamples/PretextSamples.Uno/Samplessamples/PretextSamples.Shared/SamplesSizeChanged or MeasureOverride passes.font string.Layout in measurement passes and LayoutWithLines or LayoutNextLine only when rendering needs richer output.