DynaPDF Manual - Page 418

Previous Page 417   Index   Next Page 419

Function Reference
Page 418 of 839
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.
};
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.
Remarks:
The function does not use the exception handling of DynaPDF. No error message is set if the
function fails. However, the only possible error is out of memory if the function parameters are
valid.
 

Previous topic: GetFontCount, GetFontEx (obsolete), GetFontInfo

Next topic: GetFontInfoEx, GetFontOrigin