DynaPDF Manual - Page 433
Previous Page 432 Index Next Page 434

Function Reference
Page 433 of 860
float
SpaceWidth;
// Space width in font units. A default value is set if the
// font contains no space character.
float
StemH;
// The thickness of horizontal stems.
float
StemV;
// The thickness of vertical stems.
BYTE*
ToUnicode;
// ToUnicode CMap. Only available for imported fonts.
UI32
ToUnicodeSize;
// Buffer size in bytes.
TFltPoint
VertDefPos;
// Default vertical displacement vector.
TCIDMetric*
VertWidths;
// Vertical glyph widths -> 0..VertWidthsCount -1.
UI32
VertWidthsCount;
// Number of vertical widths in the array.
UI32
WMode;
// Writing Mode -> 0 == Horizontal, 1 == Vertical.
float
XHeight;
// The height of lowercase letters measured from the baseline.
UI16*
BaseFontW;
// BaseFont converted to Unicode. This is the font name that
// Adobe's Acrobat displays in the font overview.
};
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 TPDFFontInfo
structure.
The font metrics such as Ascent, Descent, HorzWidths, VertWidths, and so on are returned in font
units. The values must be scaled to the given font size as follows:
double scale
= FontSize / 1000.0;
double ascent
= font.Ascent
* scale;
double descent = font.Descent * scale;
The font’s encoding consists of exactly 256 Unicode values if set. The encoding is not set if a CID
font is selected.
The font flags describe certain properties of the font. The most important flags are the following:
•
0x1
// Fixed pitch font
•
0x2
// Serif style
•
0x4
// Symbol font
•
0x8
// Script style
•
0x20
// Non-symbolic font
•
0x40
// Italic style
•
0x40000 // Force Bold (Type1 fonts only)
The full set of available flags can be found in the PDF Reference.
The members Length1, Length2, and Length3 are already validated. The sum of the lengths cannot
exceed the buffer size.
The member CIDToGIDMap is a buffer of the original CIDToGIDMap stream if available. The buffer
must be converted to an array of unsigned short. The values are stored in big endian format, high
order byte first.
BaseFontW is the string BaseFont converted to Unicode. This is what Adobe’s Acrobat displays as
font name in the font overview. This string is provided because BaseFont is sometimes defined in the
encoding of a CID font.
Previous topic: GetFontCount, GetFontEx (obsolete), GetFontInfo
Next topic: GetFontInfoEx, GetFontOrigin