Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 305

Previous Page 304   Index   Next Page 306

Function Reference
Page 305 of 750
// ascending order by PostScript name, so that we do not need to sort
// them again.
// Note that the font selection mode must be set to smPostScriptName
// if you want to use postscript names for font selection.
function EnumFontProc(const Data: Pointer; const FamilyName: PWideChar;
const PostScriptName: PAnsiChar; Style: TFStyle): Integer; stdcall;
var cb: TComboBox;
// Data holds the pointer of our combo box cbFonts.
cb := Data;
cb.AddItem(PostScriptName, nil);
Result := 0; // Any other return value break enumeration!
procedure TForm1.FormCreate(Sender: TObject);
// First, we create an instance of the class TPDF. This is our main
// instance used until the form will be destroyed. cbFonts is the
// combo box on our form that should be used for font selection.
PDF := TPDF.Create;
PDF.EnumHostHonts(cbFonts, @EnumFontProc);
procedure TForm1.FormDestroy(Sender: TObject);
SI32 pdfEnumHostFontsEx(
const PPDF* IPDF,
// Instance pointer
const void* Data,
// User defined pointer
TEnumFontProcEx* EnumProc) // Callback function see below
typedef SI32 PDF_CALL TEnumFontProcEx(
const void* Data,
// User defined pointer
const UI16* FamilyName,
// Family name
const char* PostScriptName, // PostScript name
SI32 Style,
// Font Style
TFontBaseType BaseType,
// Base font type
TEnumFontProcFlags Flags,
// See below
const char* FilePath)
// File path to font file
#define PDF_CALL __stdcall
// Windows only, otherwise empty

Previous topic: EnumHostFonts

Next topic: ExchangeBookmarks