[Previous] [Contents] [Index] [Next]

PfLoadFont()

Preload a font within the font server

Synopsis:

#include <photon/Pf.h>

int PfLoadFont( const char *font,
                unsigned flags, 
                FontName fontused );

Library:

ph

Description:

This function preloads a font (from disk into memory) within the font server to speed up subsequent use of the font. By default, a font is loaded only when required by PgExtentText() or PgDrawText(). The font parameter specifies the name of the desired font. You should use PfGenerateFontName() to create this.

The flags parameter consists of zero or more of the PHFONT_LOAD_METRICS or PHFONT_LOAD_IMAGES flags, which indicate if the font metrics and/or bitmaps should be preloaded. If no flags are specified, the validity of the input font name is checked.

If fontused is non-NULL, the string it points to is set to the real name of the font, which may be different than the input if the font is unknown or mapped as an alias to another font (via the fontmap file).

Returns:

0
Success.
-1
An error occurred; errno is set.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgExtentText(), PfGenerateFontName(), PgDrawText()

Fonts chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]