DynaPDF Manual - Page 498

Previous Page 497   Index   Next Page 499

Function Reference
Page 498 of 839
const UI16*
FamilyName;
// Family name
const char*
FilePathA;
// Font file path (Ansi string on Windows, UTF-8 otherwise
const UI16*
FilePathW;
// Font file path
UI32
FileSize;
// File size in bytes
TEnumFontProcFlags Flags;
// Bitmask
const UI16*
FullName;
// Full name
UI32
Length1;
// Length of the clear text portion of a Type1 font
UI32
Length2;
// Length of the eexec encrypted portion of a Type1 font
const char*
PostScriptNameA; // Postscript mame
const UI16*
PostScriptNameW; // Postscript mame
SI32
Index;
// Zero based font index if stored in a TrueType collection
LBOOL
IsFixedPitch;
// If true, the font is a fixed pitch font
TFStyle
Style;
// Font style
TUnicodeRange1
UnicodeRange1;
// Bitmask
TUnicodeRange2
UnicodeRange2;
// Bitmask
TUnicodeRange3
UnicodeRange3;
// Bitmask
TUnicodeRange4
UnicodeRange4;
// Bitmask
};
The function returns the most important properties of a system font. The member StructSize must be
set to sizeof(TPDFSysFont) before the function can be called.
If you want to know how many fonts will be returned then call EnumHostFonts() with the
parameter EnumProc set to NULL beforehand. The function returns the number of available fonts in
this case.
However, also if the number of host fonts is known, it is not possible to loop over the available fonts
from 0 to FontCount - 1 since the parameter Handle represents no array index.
In the first call set the parameter Handle to 0 or Out to NULL. In this case, the function returns the
handle of the first font file. This value must be passed to the next call until the return value is zero.
Note that if Out is set in the first call, then the first font will already be returned.
Since the return value could be zero if only one system font is available, the caller must check
whether FamilyName is non-NULL to determine whether a font was returned (all members are
initialized with zero in this case). The family name is always set if a font was returned.
Example (C#):
// This code adds the full names to a list box.
int next;
TPDFSysFont f = new TPDFSysFont();
next = 0;
next = pdf.GetSysFontInfo(next, ref f);
if (next >= 0 && f.FamilyName != null)
{
listBox1.Items.Add(f.FullName);
}
while (next > 0)
{
next = pdf.GetSysFontInfo(next, ref f);
if (next >= 0)
{
listBox1.Items.Add(f.FullName);
}
}
 

Previous topic: GetStrokeColor, GetSubmitAction, GetSysFontInfo

Next topic: GetTabLen, GetTemplCount, GetTemplHandle