Construct a list of installed fonts
#include <photon/Pf.h>
int PfQueryFonts( long symbol,
unsigned flags,
FontDetails list[],
int n );
#include <font_api.h>
int PfQueryFontsCx( struct _Pf_ctrl *context,
long symbol,
unsigned flags,
FontDetails list[],
int n );
- context
- (PfQueryFontsCx only) A pointer to the font context to use, returned by PfAttachCx() or
PfAttachDllCx().
- symbol
- The symbol that you want to be able to render, or
PHFONT_ALL_SYMBOLS if you don't want to limit the search
to fonts that support a specific character.
- flags
- Flags that you can use to filter the list of fonts; any combination of
the following:
- PHFONT_SCALABLE — select scalable fonts.
- PHFONT_BITMAP — select bitmapped fonts.
- PHFONT_PROP — select proportional fonts.
- PHFONT_FIXED — select fixed-width fonts.
- PHFONT_ALL_FONTS — select all fonts.
- PHFONT_DONT_SHOW_LEGACY — exclude legacy fonts.
This flag overrides PHFONT_ALL_FONTS.
- list
- NULL, or an array of
FontDetails
structures where the function can store information about the matching
fonts; see below.
- n
- 0, or the number of elements in the list.
- PfQueryFonts()
- ph
- PfQueryFontsCx()
- font
These functions construct 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.)
Up to n matching font family entries are placed in the
user-provided list.
|
If n is 0 and list is NULL,
these functions return the number of matching fonts but don'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:
- PHFONT_INFO_ALIAS — the entry is a mapping
or virtual font, like TextFont.
- PHFONT_INFO_BLDITC — bold italic style.
- PHFONT_INFO_BOLD — bold style.
- PHFONT_INFO_DECORATIVE — decorative style.
- PHFONT_INFO_FIXED — fixed-width font.
- PHFONT_INFO_ITALIC — italic style.
- PHFONT_INFO_PLAIN — plain/regular style.
- PHFONT_INFO_PROP — proportional-width font.
- PHFONT_INFO_SANSERIF — sans-serif font.
- PHFONT_INFO_SERIF — serif font.
Use
PfGenerateFontName() or PfGenerateFontNameCx()
and the information in the FontDetails structure
to build a font name that you can pass to functions such as
PgSetFont().
The number of matching fonts found, or -1 on error.
Photon
PfQueryFonts()
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PfQueryFontsCx()
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
PfGenerateFontName(),
PfGenerateFontNameCx(),
PfQueryFontInfo(),
PfQueryFontInfoCx(),
PgSetFont()
PtFontSel
(in the Photon Widget Reference)
Fonts
chapter of the Photon Programmer's Guide