PfQueryFontInfo(), PfQueryFontInfoCx()

Get information about a font

Synopsis:

#include <photon/Pf.h>
int PfQueryFontInfo( const char *font,
                     FontQueryInfo *info );

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

Arguments:

context
(PfQueryFontInfoCx() only) A pointer to the font context to use, returned by PfAttachCx() or PfAttachDllCx().
font
The name of the font, as created by PfGenerateFontName().
info
A pointer to a FontQueryInfo structure that the function fills with information about the font; see below.

Library:

PfQueryFontInfo()
ph
PfQueryFontInfoCx()
font

Description:

These functions get information about the font specified by font after first mapping font to a valid font name (if appropriate).

The FontQueryInfo structure pointed to by info is filled in. It contains at least:

FontName font
Internal name of the font (e.g. TextFont09).
FontDescription desc
Textual name of the font family (e.g. Helvetica).
short size
Point size of the font, or 0 for a scalable font.
unsigned short style
Style and attributes of this font, made up of the following bits:
short ascender
Ascender value of the font (in pixels).
short descender
Descender value of the font (in pixels).
short width
Width of widest character in this font.
long lochar
Lowest character value defined in this font.
long hichar
Highest character value defined in this font.

Returns:

0
Successful completion.
-1
An error occurred (errno is set.

Examples:

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

Classification:

Photon

PfQueryFontInfo()

Safety:
Interrupt handler No
Signal handler No
Thread No

PfQueryFontInfoCx()

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PfGenerateFontName(), PfGenerateFontNameCx(), PfQueryFonts(), PfQueryFontsCx()

Fonts chapter of the Photon Programmer's Guide