PfLoadMetrics(), PfLoadMetricsCx()

Load metric information for the given font

Synopsis:

#include <photon/Pf.h>
int PfLoadMetrics( const char *font );

#include <font_api.h>
int PfLoadMetricsCx( struct _Pf_ctrl * context,
                     const char * font );

Arguments:

context
(PfLoadMetricsCx() only) A pointer to the font context to use, returned by PfAttachCx() or PfAttachDllCx().
font
The name of the font, as created by PfGenerateFontName() PfGenerateFontNameCx()or.

Library:

PfLoadMetrics()
ph
PfLoadMetricsCx()
font

Description:

These functions load metric information for the given font from the font server into memory and link this font into a list of available local metrics.

Subsequent text extents of this base font, involving characters solely within this font, are performed locally by the task itself rather than by the font server. This may result in faster operation of extent-intensive tasks, such as HTML viewers, at a cost of about 1400 bytes of memory per font (for a standard font that defines characters 0x20-0xFF).


Note: In instances where the font metrics do not contain the glyph, messaging will be used as a fallback method.

Returns:

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

Examples:

PfLoadMetricsCx(): See the example for PfConvertPixelsToPointSizeCx().

Classification:

Photon

PfLoadMetrics()

Safety:
Interrupt handler No
Signal handler No
Thread No

PfLoadMetricsCx()

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PfGenerateFontName(), PfGenerateFontNameCx(), PfUnloadMetrics(), PfUnloadMetricsCx()

Fonts chapter of the Photon Programmer's Guide