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


Construct a list of fonts


#include <photon/Pf.h>

int PfQueryFonts( long symbol, 
                  unsigned flags, 
                  FontDetails list[], 
                  int n );


This function constructs a list of all fonts that may be used to render the character specified by the symbol parameter. For example, use 'A' to get a list of normal/Latin fonts, or 0x3A9 (omega) to get a list of Greek fonts. (See PkKeyDef.h or ISO/EIC 10646-1 for a list of symbols.)

The list of fonts is further filtered by the flags parameter, which may contain any combination of the following:

Set this: To select:
PHFONT_SCALABLE Scalable fonts
PHFONT_BITMAP Bitmapped fonts
PHFONT_PROP Proportional fonts
PHFONT_FIXED Fixed-width fonts

Up to n matching font family entries are placed in the user-provided list.

Note: If n is 0 and list is NULL, PfQueryFonts() returns the number of matching fonts but doesn't try to fill in the list. You can use this feature to determine the number of items to allocate for the list.

The entries in the list are of type FontDetails, and contain the following fields:

FontDescription desc
Textual name of the font family (e.g. Helvetica).
FontName stem
Base stem of the font family (e.g. helv).
short losize
Lowest point size available for this font. If losize and hisize are both 0, the font is scalable.
short hisize
Highest point size available for this font. If hisize and losize are both 0, the font is scalable.
unsigned short flags
Various stylistic/attribute flags for this font family:


The number of matching fonts found, or -1 on error.



Interrupt handler No
Signal handler No
Thread No

See also:

PtFontSel (in the Photon Widget Reference)

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