| Category | Font enumeration |
|---|---|
| Note | coarse TFontType classification (see Remarks) |
Purpose — Enumerate every registered font entry via a callback, receiving a PFNT handle usable with pdfReplaceFont/Ex.
Description — For each entry, calls EnumProc(Data, PDFFont, FontType, BaseFont, FontName, Embedded, IsFormFont, Flags). Passing EnumProc=NULL short-circuits to just returning the count (same value as pdfGetFontCount).
Declarations
int32_t __stdcall pdfEnumDocFonts(PPDF IPDF, void* Data, TEnumFontProc2 EnumProc);
function pdfEnumDocFonts(const IPDF: PPDF; const Data: Pointer; EnumProc: TEnumFontProc2): Integer; stdcall; external 'LumasPdf.dll';
TEnumFontProc2:
TEnumFontProc2 = function(const Data, PDFFont: Pointer; FontType: TFontType;
const BaseFont, FontName: PAnsiChar; Embedded, IsFormFont: LongBool;
Flags: Cardinal): Integer; stdcall;
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Data | Pointer | Opaque context passed through to each callback invocation. |
EnumProc | TEnumFontProc2 | Callback; NULL just returns the count without enumerating. |
Return value — Total font entry count.
Remarks — coarse type classification. Every TrueType entry (whether a simple embedded face or a CID/Type0 setup) is reported as ftType0 with Embedded=TRUE; every other entry (standard-14, Type 1, CID-predefined) is reported as ftType1 with Embedded=FALSE. This is accurate for the common cases but does not distinguish, e.g., a simple embedded TrueType font from a genuinely CID-keyed Type0 font — both surface identically through this enumeration. IsFormFont is always FALSE and Flags always 0 in this build.
See also — pdfGetFontCount, pdfReplaceFont
C# (P/Invoke)
public static extern int pdfEnumDocFonts(IntPtr IPDF, IntPtr Data, TEnumFontProc2 EnumProc);
Core
pdfEnumDocFonts
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.