PfGlyph(), PfGlyphCx()

Obtain the metrics and/or bitmap for the specified character

Synopsis:

#include <photon/Pf.h>

int PfGlyph( const char *font,
             long symbol,
             FontRender *metrics,
             unsigned char *bitmap,
             int size,
             FontName fontused);

#include <font_api.h>
int PfGlyphCx( struct _Pf_ctrl *context,
               const char *font,
               long symbol,
               FontRender *metrics,
               unsigned char *bitmap,
               int size,
               FontName fontused);

Arguments:

context
(PfGlyphCx() only) A pointer to the font context to use, returned by PfAttachCx() or PfAttachDllCx().
font
The base font to use, which you should create by calling PfGenerateFontName() or PfGenerateFontNameCx().
symbol
The character that you're interested in.
metrics
NULL, or a pointer to a FontRender structure, which the function fills in with the character metrics (see PfRender()).
bitmap
NULL, or a pointer to a block of memory where the function can store the character bitmap.
size
The number of bytes in the block that bitmap points to.
fontused
NULL, or a buffer where the function can store the name of the font that supplies the character.

Library:

PfGlyph()
ph
PfGlyphCx()
font

Description:

These routines are useful for obtaining arbitrary character glyphs, such as cursors. The functions obtain from the base font the metrics and/or bitmap for the character specified by symbol.

When bitmap is non-NULL, it must point to an area of size bytes that the character bitmap can be placed in. It may be rendered as a bitmap/image in conjunction with the metrics information. The actual font used to supply the character is placed in the string pointed to by fontused if non-NULL.

Returns:

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

Examples:

PfGlyphCx(): See the example for PfGetGlyphIndexCx().

Classification:

Photon

PfGlyph()

Safety:
Interrupt handler No
Signal handler No
Thread No

PfGlyphCx()

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PfGenerateFontName(), PfGenerateFontNameCx(), PfGetOutline(), PfGetOutlineCx(), PfRender(), PfRenderCx()

Fonts chapter of the Photon Programmer's Guide