HPDFXFABuildButtonAppearance
Unit: HPDFXFAHeadless
function HPDFXFABuildButtonAppearance(const Text, Style: AnsiString;
Width, Height: Double; const TrueTypeFont: SysUtils.TBytes;
FirstObjectNumber: Integer; const Options: TXFAHeadlessPDFOptions;
const ResolvedCaptionRuns: THPDFHeadlessRichTextRuns = nil): THPDFXFAButtonAppearance;
Prepares one actual pushbutton appearance using the same caption, state, font and layout consumers as automatic headless XFA creation; Text is UTF-8, Style is the metadata emitted by the XFA layout callback, and Width/Height are physical PDF points
TrueTypeFont supplies the real default program; Options.CaptionFontFamilies supplies additional actual regular, bold, italic and bold-italic programs, together with their declared labels
FirstObjectNumber must be positive and leave room for all generated consecutive object numbers; the returned bundle owns the reachable native objects and separate widget-property and default-font roots
The factory never changes a caller document or writes a caller stream; font, glyph, input, object, serialisation-byte and cancellation checks apply during preparation
With nil ResolvedCaptionRuns, the existing configured-family path is preserved; the optional override supports a separately resolved installed-font catalogue without replacing the authored text or formatting
A nonempty override requires the current rich caption payload and exactly matching run count, text, style, size, color, underline, strikeout, paragraph boundary, alignment and ordered FontFamilyCandidates; only FontFamily may change to a configured label
The shared font fallback then chooses a real family that covers the complete grapheme across all participating styles; missing bold or italic programs are never synthesised
Normal/down/rollover caption metadata, explicit empty captions, hidden captions and the normal zero-reserve behaviour follow pushbutton caption semantics