Unicode line breaking

HPDFUnicodeLineBreaks implements Unicode 17.0.0 default line-break opportunities with the checked-in Line_Break, General_Category, East_Asian_Width and Extended_Pictographic properties

The portable implementation resolves combining sequences, punctuation context, numeric expressions, Hangul, Brahmic orthographic syllables, emoji modifiers and paired regional indicators without a segmentation DLL

The function returns the position before the first scalar and after every scalar, expressed as zero-based UTF-16 offsets; each position is prohibited, allowed or mandatory

The end of text is mandatory, including for empty input; the start of nonempty text is prohibited, and paired surrogates have no interior position

Default Southeast Asian handling resolves ordinary SA characters to AL and SA combining marks to CM; language dictionaries and hyphenation are separate tailoring services

HPDFUnicodeLineBreakClass exposes the raw or LB1-resolved property for individual code points; THPDFUnicodeLineBreakClass names retain every Unicode 17 property abbreviation

The existing HPDFComputeLineBreaks and HPDFLineBreakClassOf document APIs consume the same complete tables on Delphi 2009 and later and supported FPC targets, preserving established enum ordinals and empty-input behavior

Malformed UTF-16 and code-unit budgets outside one through 1048576 raise EArgumentException; cancellation is checked before allocation, while decoding and while evaluating boundaries

Actual rich field layout

Wrapped typed rich runs consume legal default opportunities, keep nonbreaking-space groups and opening punctuation together, and honor CRLF, NEL, LINE SEPARATOR and PARAGRAPH SEPARATOR as explicit breaks

Original separators remain in V and canonical RV; line separators are omitted from painted glyph fragments, and overwide groups use the existing complete-grapheme emergency wrapping

Independent fragments on the same actual line continue at measured advances; legal breaks do not require a separate physical line unless fitting selects them

Complete paragraph opportunities preserve legal groups across style changes and coalesce split CRLF; actual styled advances decide when a whole fitting group moves to a fresh line

Cross-style grapheme emergency fitting and contextual shaping, mixed-style paragraph bidi, arbitrary XHTML and language-specific tailoring remain active integration targets

Conformance

HotPDFUnicodeLineBreakTests consumes all 19338 official Unicode 17 LineBreakTest cases and compares every published position; the mandatory end and malformed, budget and cancellation behavior have separate checks

Build-UnicodeLineBreakTables.py --check verifies reproducibility and the SHA-256 pins of the three additional UCD property inputs

Unicode 17 line-breaking rules · Boundary function · Returned positions · Rich field integration