A widget for selecting font attributes
PtWidget --> PtBasic --> PtContainer --> PtFontSel
For more information, see the diagram of the widget hierarchy.
<photon/PtFontSel.h>
The PtFontSel widget allows user selection of a font family, style, and size. It provides a combobox for selecting the family, an editable combobox for selecting the font size, and buttons for selecting bold, italic, and anti-aliased styles.
A PtFontSel widget.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_FONT_DISPLAY | unsigned | Flag | Pt_FONTSEL_ALL_FONTS |
Pt_ARG_FONT_FLAGS | unsigned | Flag | Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK |
Pt_ARG_FONT_NAME | char * | String | "helv12" |
Pt_ARG_FONT_SAMPLE | char * | String | "AaBbCcXxYyZz" |
Pt_ARG_FONT_SYMBOL | long | Scalar | 'A' |
Pt_CB_FONT_MODIFY | PtCallback_t * | Link | NULL |
C type | Pt type | Default |
---|---|---|
unsigned | Flag | Pt_FONTSEL_ALL_FONTS |
Flags to filter the inclusion of font families in the selection dialog (see PtFontSelection() in the Photon Library Reference). These flags may be ORed together - the value Pt_FONTSEL_ALL_FONTS is provided to override this filtering:
C type | Pt type | Default |
---|---|---|
unsigned | Flag | Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK |
Flags to modify the appearance of the widget:
C type | Pt type | Default |
---|---|---|
char * | String | "helv12" |
The name of the initial font. This resource also reflects the currently selected font.
C type | Pt type | Default |
---|---|---|
char * | String | "AaBbCcXxYyZz" |
The string to be used as a sample display of the font (if the Pt_FONTSEL_SAMPLE flag is set).
C type | Pt type | Default |
---|---|---|
long | Scalar | 'A' |
A character used to filter the inclusion of font families in the selection dialog. Only those fonts which define this character are included. This resource may be used to display only Latin fonts (use 'A') or Cyrillic fonts (use Pk_Cyrillic_IO). The value Pt_FONTSEL_ALL_SYMBOLS may be used to override this filtering.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callback functions invoked whenever the selected font is modified.
If the widget has the Pt_CALLBACKS_ACTIVE bit set in its Pt_ARG_FLAGS resource, this callback is also invoked when the selected font is changed by a call to PtSetResources().
Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
These callbacks should return Pt_CONTINUE.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
The PtFontSel class defines the following convenience function: