DynaPDF Manual - Page 386

Previous Page 385   Index   Next Page 387

Function Reference
Page 386 of 787
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 member FontFile provides a pointer to the font file buffer if the font is embedded and if it was
imported from an external PDF file. In this case and if the font type is not ftType1 the member
Length1 specifies the length of the font buffer.
Type1 fonts consist of three portions. Length1 specifies the length of the clear text portion, Length2
specifies the length of the eexec encrypted binary portion, and Length3 specifies the length of the
fixed content portion (512 zeros plus cleartomark). The latter portion is optional and mostly not set
in PDF fonts. The buffer length is the sum of the three lengths.
If the font was loaded from the system the parameter FontFile contains the file path to the font file.
The member Length1 is set to zero in this case.
Since DynaPDF 3.0.8.16 the default string format for font file paths on Windows was changed to
UTF-16. You can make a type cast to UI16* on Windows, as long as the Ansi version of
AddFontSearchPath() will not be used.
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 parameters are valid.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: GetFont (obsolete)

Next topic: GetFontCount, GetFontEx (obsolete), GetFontInfo

Start Chat