textPolicy property
The surface's text width/lowering policy (RFC 0019), as the width probe resolved it on a real terminal.
Defaults to TextPresentationPolicy.spec — every ambiguous-width glyph
is one cell — which is what serve reports and what an unprobed surface
falls back to. It is NOT what most real terminals resolve to: the probe
runs unconditionally at startup and measures ambiguous glyphs two cells
wide on roughly 19 of 30 surveyed terminals, including the macOS, GNOME
and VS Code defaults. A suite that only ever runs on spec cannot see a
width bug that only exists off it (the launch audit's 4.a shipped that
way), so tests whose subject draws box-drawing glyphs, an ellipsis, a
scrollbar thumb or CJK should run under both — see
testWidgetsOnBothTextPolicies.
Like viewportSize, a change after the first pumpWidget flows into the ambient MediaQuery and rebuilds dependents.
Implementation
TextPresentationPolicy get textPolicy => _textPolicy;
Implementation
set textPolicy(TextPresentationPolicy value) {
if (value == _textPolicy) return;
_textPolicy = value;
_refreshSurface();
}