API referenceFonts

pdfEnumDocFonts

Enumerate every registered font entry via a callback,

CategoryFont enumeration
Notecoarse 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

C
int32_t __stdcall pdfEnumDocFonts(PPDF IPDF, void* Data, TEnumFontProc2 EnumProc);
Delphi
function pdfEnumDocFonts(const IPDF: PPDF; const Data: Pointer; EnumProc: TEnumFontProc2): Integer; stdcall; external 'LumasPdf.dll';

TEnumFontProc2:

Delphi
TEnumFontProc2 = function(const Data, PDFFont: Pointer; FontType: TFontType;
  const BaseFont, FontName: PAnsiChar; Embedded, IsFormFont: LongBool;
  Flags: Cardinal): Integer; stdcall;

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
DataPointerOpaque context passed through to each callback invocation.
EnumProcTEnumFontProc2Callback; 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 alsopdfGetFontCount, pdfReplaceFont

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfEnumDocFonts(IntPtr IPDF, IntPtr Data, TEnumFontProc2 EnumProc);
Area
Fonts
Category

Core

Exported names

pdfEnumDocFonts

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.