Supplied Rich Text Font Fallback
Set THPDFHeadlessTextAppearanceOptions.FallbackFontFamilies to True to resolve missing rich-text glyphs from the families supplied to HPDFBuildHeadlessRichTextFamilyAppearance or SetRichTextFieldValueWithFamilies
The default is False, preserving strict selection of each authored family and style; the single-font text builder does not search for other families
Options:= THPDFHeadlessTextAppearanceOptions.Default;
Options.FallbackFontFamilies:= True;
Document.SetRichTextFieldValueWithFamilies(FieldIndex, Runs, Families, Options);
Selection and shaping
The resolver uses complete Unicode 17 extended grapheme boundaries across adjacent authored style runs and empty run seams within each paragraph; a family decision never splits a surrogate pair, combining sequence, variation sequence or joiner cluster
When the first affected run supplies FontFamilyCandidates, its declared order takes precedence and each configured candidate must cover every styled part of the complete grapheme; if none qualifies, the existing selected-family and supplied-array fallback rules below apply
If the selected programs cover the whole grapheme, their authored families remain in use; otherwise the resolver first tries the first affected run's family, followed by the supplied families in array order, selecting one family that covers every styled part of the complete grapheme with the corresponding actual regular, bold, italic or bold-italic program
Missing style programs are skipped as candidates, whilst a malformed program that must be inspected produces a typed invalid-font error; layout and shaping controls do not require visible cmap glyphs; a grapheme that no supplied family covers produces haMissingGlyph
Existing contextual shaping, bidirectional ordering, cross-style mark placement, wrapping, explicit paragraph breaks and widget rotation apply to the resolved appearance runs
Values and transactions
Fallback runs exist only during appearance preparation; the caller's runs remain unchanged and the document stores the original plain value and authored rich markup in V and RV
Typed point sizes and RGB components pass directly to appearance layout without being reconstructed from the serialised rich value, whose canonical text representation has its own precision
Family-aware FDF and XFDF imports accept the same option and retain their existing immutable-source, signature, security, semantic no-op and publication contracts
Bounds and dependencies
The aggregate MaxFontBytes limit counts each family/style program inspected during fallback, including valid candidates that are not eventually embedded; the appearance embeds only the selected styles
Existing UTF-16 input, glyph, object and byte budgets remain in force, and resolution may produce at most 4096 styled runs; cancellation is checked during font selection and scalar coverage as well as during layout and publication
Complex shaping retains the existing HarfBuzz and FriBidi dependencies; fallback uses supplied font bytes only, with no implicit system font discovery, generic aliases, downloaded fonts or downloaded style sheets; explicit ordered font candidate lists retain supported inline CSS family order
Native family APIs expose this option; Linux named-family JSON accepts the same opt-in flag and prepares actual candidate programs; Windows callback fallback loading remains separate work
Acceptance
Six native compiler targets each pass 199 checks over 30 saved PDFs and 1098 independent value, embedded-font, glyph, shaping, precision, line and visible-pixel checks; actual subset and full font programs cover all four styles, cross-style combining marks, Arabic joining, Hebrew, supplementary joiners, ordered family candidates, AES R5/R6, FDF/XFDF, typed budgets and eight selected cancellation checkpoints including the final checkpoint
Fresh C++Builder interfaces compile both architectures; genuine released missing-glyph evidence and the successful actual primary/fallback/primary widget glyph proof are preserved separately