TXFAHeadlessPDFOptions.CaptionFontFamilies
Unit: HPDFXFAHeadless
CaptionFontFamilies: THPDFHeadlessRichTextFontFamilies;
Supply actual TrueType programs for automatic checkbox, radio and push button captions, including rich XHTML runs and scalar caption font weight, posture and typeface
Default returns an empty array; the existing TrueTypeFont parameter supplies the default regular face, while requested bold, italic and bold-italic faces require their own real programs
An explicit array contains one to sixteen families with distinct, nonempty names accepted by the native rich-text decoder; its first family is the default, and a missing first regular program uses TrueTypeFont
Caption font.typeface selects a configured family by name, falling back to the first family when it is not configured; XHTML CSS font-family lists use the decoder's existing configured-family selection
Each selected style uses its corresponding hrfsRegular, hrfsBold, hrfsItalic or hrfsBoldItalic byte array; the creator neither synthesizes faces nor loads fonts from the operating system or a network
These families apply to Boolean and push button captions; other generated fields retain the original TrueTypeFont contract
procedure ConfigureCaptionFaces(var Options: TXFAHeadlessPDFOptions;
const RegularBytes, BoldBytes, ItalicBytes, BoldItalicBytes: TBytes);
begin
SetLength(Options.CaptionFontFamilies, 1);
Options.CaptionFontFamilies[0].FamilyName := 'Primary';
Options.CaptionFontFamilies[0].Fonts[hrfsRegular] := RegularBytes;
Options.CaptionFontFamilies[0].Fonts[hrfsBold] := BoldBytes;
Options.CaptionFontFamilies[0].Fonts[hrfsItalic] := ItalicBytes;
Options.CaptionFontFamilies[0].Fonts[hrfsBoldItalic] := BoldItalicBytes;
end;
Initialize Options with Default and provide the program bytes before calling the creator; do not mutate those arrays during the synchronous call
MaxFontBytes bounds the original default program and the aggregate unique style programs used by each caption; MaxBytes additionally bounds all embedded programs across the candidate PDF
Style programs are shared between fragments within one caption; Boolean states share their common caption Form, while separately authored push button states retain separate caption font graphs
Missing faces, missing glyphs, invalid font programs, resource-budget failures and cancellation abort candidate preparation without changing the caller's destination stream
Options and budgets · Rich caption consumer behavior · Push button captions and states