Unicode line breaking
HPDFUnicodeLineBreaks implements Unicode 17.0.0 default line-break opportunities using 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 any 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, permitted or mandatory
The end of text is mandatory, including for empty input; the start of non-empty text is prohibited, and paired surrogates have no interior position
The 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 keep 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 behaviour
Malformed UTF-16 and code-unit budgets outside one to 1048576 raise EArgumentException; cancellation is checked before allocation, whilst decoding and whilst evaluating boundaries
Actual rich field layout
Wrapped typed rich runs consume legal default opportunities, keep nonbreaking-space groups and opening punctuation together, and honour 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 fall back to 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 chooses them
Complete paragraph opportunities preserve legal groups across style changes and coalesce split CRLF; actual styled advances determine 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 are still 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 behaviour have separate checks
Build-UnicodeLineBreakTables.py --check confirms 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