HPDFPrepareHeadlessRichTextLineBoxes

function HPDFPrepareHeadlessRichTextLineBoxes(
  const Runs: THPDFHeadlessRichTextRuns; MaximumRuns: Integer;
  CancellationToken: THPDFCancellationToken = nil): THPDFHeadlessRichTextRuns;

Returns a separate run sequence with the metric-only paragraph struts needed by explicit rich line heights; it does not modify the caller's authored run records

MaximumRuns must be from one to 4096 and includes inserted struts; exceeding that capacity raises EHPDFHeadlessAppearanceError with haLimitExceeded

A paragraph containing an explicit height receives a strut copied from its first authored run when no explicit strut exists; a legacy first height becomes normal, and other legacy child heights remain normal rather than inheriting a sibling factor

An existing IsParagraphStrut run must be the first empty run of its paragraph and must carry a nonlegacy height; malformed metric-run placement raises haInvalidOptions

ParagraphBreakBefore moves to the inserted strut so plain text retains exactly its original paragraph boundaries; all-legacy paragraphs preserve their existing run sequence and values

Font planners should include every nonempty run and every IsParagraphStrut run from the prepared sequence, because empty struts require their actual supplied face and style metrics

The optional cancellation token is polled during preparation and propagates EHPDFOperationCancelled; the function performs no file access, font loading, PDF publication or callback commit

Preparation validates its bounded paragraph structure; ordinary Unicode, colour, size, font-program and object-budget validation remains with the rich serialiser and appearance builder

Line-height behaviour · Run record