Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 517

Previous Page 516   Index   Next Page 518

Function Reference
Page 517 of 767
with different code pages. The function compares the absolute file path and not the font name.
Therefore, it is strongly recommended to load fonts always from the same directories.
The parameter Style sets the style flags fsUnderlined, fsStriked, or fsVerticalLayout only. It is also
possible to emulate font styles with manually loaded fonts. Use the function ChangeFontStyleEx() if
a font style should be emulated.
If the font name is known by the caller then it is also possible to set the font later with SetFont().
However, for proper behaviour manually loaded fonts should always be set with ChangeFont().
If SetFont() is used then there is no guarantee that the function loads exactly this font because the
function tries to load the best match according to the provided parameters.
The parameter Index is used to load a specific sub font of a TrueType Collection. If a normal font is
loaded or if the index is unknown set the parameter to zero. Note that the parameter is used when
DynaPDF performs the duplicate check.
Remarks:
A font file that was loaded with function must not be deleted or modified before the PDF file was
closed or discarded.
Like all other fonts, manually loaded fonts are unloaded when the PDF file is closed or discarded
with FreePDF().
The function is implemented in an Ansi and Unicode compatible variant. The Unicode version is
preferred on Windows because Unicode is the default string format that DynaPDF uses for font files
on this platform.
Unicode file paths are converted to UTF-8 on non-Windows operating systems.
Return values:
If the function succeeds the return value is the font handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
 

Previous topic: LoadFontEx

Next topic: MovePage