DynaPDF Manual - Page 414
Previous Page 413 Index Next Page 415
Function Reference
Page 414 of 839
GetFont (obsolete)
Syntax:
LBOOL fntGetFont(
const void* IFont,
// Pointer of a font object
struct TPDFFontObj* F) // Structure to be filled
struct TPDFFontObj
{
float
Ascent;
// Ascent
char*
BaseFont;
// PostScript Name or Family Name
float
CapHeight;
// Cap height
float
Descent;
// Descent
UI16*
Encoding;
// Unicode mapping 0..255 if set
UI32
FirstChar;
// First char
UI32
Flags;
// Font flags -> font descriptor
char*
FontFamily;
// Optional Font Family (Family Name)
LBOOL
FontFamilyUni; // Is FontFamily in Unicode format?
char*
FontName;
// Font name -> font descriptor
TFontType FontType;
// If ftType0 the font is a CID font.
float
ItalicAngle;
// Italic angle
UI32
LastChar;
// Last char
float
SpaceWidth;
// Space width in font units or default value.
float*
Widths;
// Glyph widths 0..WidthsCount -1
UI32
WidthsCount;
// Number of widths in the array
float
XHeight;
// x-height
float
DefWidth;
// Default character widths
char*
FontFile;
// File buffer (if imported & embedded) or file path.
UI32
Length1;
// Clear text portion of Type1 font, or full length.
UI32
Length2;
// Encrypted portion of a Type1 font program.
UI32
Length3;
// Length of the fixed-content portion or zero.
TFontFileSubtype FontFileType; // See below;
typedef enum
{
ftMMType1
= 0, // Multiple Master
ftTrueType = 1, // TrueType font
ftType0
= 2, // CID font
ftType1
= 3, // Type1 font
ftType3
= 4
// Type3 font
}TFontType;
typedef enum
{
ffsType1C
= 0, // CFF based Type1 font
ffsCIDFontType0C = 1, // CFF based Type1 CID font
ffsOpenType
= 2, // TrueType based OpenType font
ffsOpenTypeC
= 3, // CFF based OpenType font
ffsCIDFontType2
= 4, // TrueType based CID Font
ffsNoSubtype
= 9
// The font file is in the format of FontType
}TFontFileSubtype;
This function is marked as obsolete since an extended version is available now. Please use
GetFontInfo() if possible.
The function returns the most important properties of a font. The parameter IFont must be a valid
pointer to a font object. Such a pointer is returned by GetPageText(), EnumDocFonts(), or by the
content parser (see ParseContent()). The parameter F must be a valid pointer to a TPDFFontObj
structure.
The font metrics such as Ascent, Descent, Widths, and so on are returned in font units. The values
must be scaled to the given font size as follows:
Previous topic: GetFileSpec, GetFillColor
Next topic: GetFontCount, GetFontEx (obsolete), GetFontInfo