HPDFXFAReadInstalledFont

Windows unit: HPDFXFAWindowsFonts

function HPDFXFAReadInstalledFont(const Family: UnicodeString;
  Style: THPDFHeadlessRichTextFontStyle; MaximumFontBytes: Integer;
  CancellationToken: THPDFCancellationToken; out Font: SysUtils.TBytes;
  out ActualFamily: UnicodeString): Boolean;

Reads an actual installed TrueType program for the requested GDI family and regular, bold, italic or bold-italic style without creating a window or launching a reader

Returns False with an empty Font array when the family is missing, GDI substitutes another family, the selected face is synthesized, or usable TrueType outlines are unavailable

ActualFamily reports the selected GDI family for diagnostic use; callers must use the Boolean result before treating Font as an available program

MaximumFontBytes must be positive; the table directory and aggregate aligned table lengths are checked before allocating the complete program buffer

The function reconstructs a standalone sfnt from the selected face's actual tables and recalculates its global checksum, including when GDI selected a face from a font collection

The selected-face table access follows the GDI GetFontData contract

Cancellation checks occur during selection, table reads and checksum work; exceptions propagate, and device contexts, selected objects and GDI font handles are released

The returned program is caller-owned managed memory