Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 119

Previous Page 118   Index   Next Page 120

Function Reference
Page 119 of 750
AddFontSearchPath
Syntax:
SI32 pdfAddFontSearchPath(
const PPDF* IPDF,
// Instance pointer
const char* APath, // Path to font file directory
SI32 Recursive)
// Include subdirectories (search recursively)
This function adds a search path to the list of available font search paths. An arbitrary number of
search paths can be added at runtime. Subdirectories are added recursively if the parameter
Recursive is true.
DynaPDF requires no separate metric files for Type1 fonts.
This function is implemented in an Ansi and Unicode compatible version. On non-Windows
operating systems, Unicode paths are converted to UTF-8 and passed to the Ansi version of the
function.
Extensions:
Since DynaPDF version 3.0.21.56 it is also possible to pass a font file to the function. This makes it
possible to load a specific font file with the same rules as other fonts in a search directory. The file
extension is not used to identify the font format. Resource forks, suitcases and dfont resources are
supported on Mac OS X. Note that the font file is not loaded into memory; it is just added to the list
of font files.
Remarks:
The list of search directories can be cleared at runtime with the function ClearHostFonts().
If system fonts are enabled (default) DynaPDF adds the default font directories of the operating
system automatically to the list of font search paths (Windows and Mac OSX only, see
SetUseSystemFonts() for further information). On Windows this is the %WINDIR%/Fonts directory
as well as fonts listed in the Registry and linked fonts.
On Mac OSX the following directories are added to the list of font search paths (in this order):
~/Library/Fonts
/Library/Fonts
/System/Library/Fonts
Return values:
If the function succeeds the function returns the number of found font files (this is maybe not the
number of available fonts, because the list is cleared each time all fonts in the list are processed
during font selection). If the function fails a negative error code is returned.
 

Previous topic: AddFileComment

Next topic: AddImage