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, whilst requested bold, italic and bold-italic faces require their own real programs

An explicit array contains one to sixteen families with distinct, non-empty 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 synthesises faces nor loads fonts from the operating system or a network

These families apply to Boolean and push button captions; other generated fields keep 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;

Initialise 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, whilst separately authored push button states keep separate caption font graphs

Missing faces, missing glyphs, invalid font programs, resource-budget failures and cancellation abort candidate preparation without the caller's destination stream being touched

Options and budgets · Rich caption consumer behaviour · Push button captions and states