DynaPDF Manual - Page 342
Previous Page 341 Index Next Page 343
Function Reference
Page 342 of 839
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
EnumDocFonts
Syntax:
SI32 pdfEnumDocFonts(
const PPDF* IPDF,
// Instance pointer
const void* Data,
// User defined pointer
TEnumFontProc2* EnumProc) // Callback function see below
typedef SI32 PDF_CALL TEnumFontProc2(
const void* Data,
// User defined pointer
const void* PDFFont,
// Pointer to font object for use with GetFont()
TFontType Type,
// PDF Font type
const char* BaseFont,
// Base font (PostScript or Family Name)
const char* FontName,
// Font name taken from the font descriptor
LBOOL Embedded,
// If true, the font is embedded
LBOOL IsFormFont,
// It true, the font is reserved for form fields
UI32 Flags)
// Various font properties
#define PDF_CALL __stdcall // Windows only, otherwise empty
typedef enum
{
ftMMType1
= 0, // Multiple Master
ftTrueType = 1, // TrueType font
ftType0
= 2, // CID font (multi-byte font)
ftType1
= 3, // Type1 font
ftType3
= 4
// Type3 font (kostructed with PDF objects
}TFontType;
The function enumerates all fonts used in the current PDF document. If the parameter EnumProc is
set to NULL the function returns the number of fonts used in the document. The callback function
provides the most important properties of the font as well as a pointer to the font object that can be
used to get further information about the font with GetFont(). The return value of the callback must
be 0, every other value breaks processing.
The parameters BaseFont and FontName represent the original values stored in the font object or font
descriptor. Both strings are provided because many PDF drivers set incorrect or different values to
the font name and base font.
However, font names returned by the callback function begin often with a prefix like “AOMDMK+”.
Such a prefix is used to mark a font as a subset. In general, the parameter BaseFont contains either
the family name or the postscript name of the font.
The real font name can be extracted with the function fntBuildFamilyNameAndStyle(). The function
inspects the font names and other variables of the font object and font descriptor to determine what
kind of name is provided and to extract the font style.
Previous topic: EndContinueText (obsolete), EndLayer, EndPage, EndPattern, EndTemplate
Next topic: EnumHostFonts