Rich Text Style Group Wrapping

Typed rich field appearances calculate Unicode 17 default line-break opportunities over complete paragraphs, whilst retaining the original style offsets for every painted fragment

A change of font style, size or colour does not create a legal word boundary; non-breaking spaces, opening punctuation and numeric context remain connected across run boundaries

When a legal group fits a fresh line, the layout measures each actual styled fragment through the same appearance builder used for painting and moves the whole group across before appending any fragment when the current line lacks room

Each run keeps its font, size, colour and decorations; different point sizes share the actual line baseline derived from each embedded font's metrics

Groups wider than the content rectangle use complete styled grapheme ranges for emergency fitting, preserving base characters and combining marks on one physical line across style seams; shaping across styles is still further integration work

A CRLF split between adjacent style runs creates one actual line break and one canonical XHTML br element, including when empty style runs occur between CR and LF

An explicit paragraph transition separates the contexts and picks the next paragraph's first run alignment

Disabling WrapText preserves a single physical line across style changes, whilst explicit line and paragraph breaks still apply

Run offsets and group cursors advance through the paragraph without scanning the full style array at every scalar boundary; glyph, font, fragment, object and cancellation limits still apply

The native JSON forms.fill operation reaches the same group fitting and keeps its established operation record layout and transactional publication

Actual acceptance

Saved fixtures cover a word spanning regular and bold text, a non-breaking-space seam, opening parentheses, CRLF split between styles, a currency and decimal group, mixed point sizes and disabled wrapping

Independent readers inspect exact V and RV, embedded font identities, actual glyph maps and advances, inner text matrices plus outer transforms, physical baselines, content bounds and visible pixels for both widgets

Mixed-style paragraph bidi, contextual joining across style changes, arbitrary XHTML and additional CSS consumers are separate active work

Native rich fields · Unicode opportunities · Grapheme fitting