Get information about a font
#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 );
- 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.
- PfQueryFontInfo()
- ph
- PfQueryFontInfoCx()
- font
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:
- 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.
- 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.
- 0
- Successful completion.
- -1
- An error occurred
(errno
is set.
PfQueryFontInfoCx(): See the example for PfGetGlyphIndexCx().
Photon
PfQueryFontInfo()
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PfQueryFontInfoCx()
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
PfGenerateFontName(),
PfGenerateFontNameCx(),
PfQueryFonts(),
PfQueryFontsCx()
Fonts
chapter of the Photon Programmer's Guide