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 lets you select font attributes.
A PtFontSel widget lets you select the:
The PtFontSel shows sample text that reflects the current font format choices.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_FONT_DISPLAY | unsigned short | Flag | Pt_FONTSEL_ALL_FONTS |
Pt_ARG_FONT_FLAGS | unsigned short | Flag | Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK |
Pt_ARG_FONT_LBL_BKGDCOLOR | char * | String | "Bkgd:" |
Pt_ARG_FONT_LBL_FONT | char * | String | "Font:" |
Pt_ARG_FONT_LBL_SIZE | char * | String | "Size:" |
Pt_ARG_FONT_LBL_STYLE | char * | String | "Style:" |
Pt_ARG_FONT_LBL_TEXTCOLOR | char * | String | "Text:" |
Pt_ARG_FONT_NAME | char * | String | "TextFont09" |
Pt_ARG_FONT_POINT_SIZE_MAX | long | Scalar | 9999 |
Pt_ARG_FONT_SAMPLE | char * | String | "AaBbCcXxYyZz" |
Pt_ARG_FONT_SYMBOL | long | Scalar | 'A' |
Pt_ARG_FONT_TEXT_COLOR | PgColor_t | Scalar | Pg_BLACK |
Pt_ARG_FONT_TEXT_BKGD_COLOR | PgColor_t | Scalar | Pg_WHITE |
Pt_CB_FONT_MODIFY | PtCallback_t * | Link | NULL |
C type | Pt type | Default |
---|---|---|
unsigned short | Flag | Pt_FONTSEL_ALL_FONTS |
Flags to filter the inclusion of font families in the selection dialog (see PtFontSelection() in the Photon Library Reference). You can OR these flags together:
You can use Pt_FONTSEL_ALL_FONTS to override this filtering.
C type | Pt type | Default |
---|---|---|
unsigned short | Flag | Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK |
Flags to modify the appearance of the widget:
C type | Pt type | Default |
---|---|---|
char * | String | "Bkgd:" |
The label for the background color.
C type | Pt type | Default |
---|---|---|
char * | String | "Font:" |
The label beside the combo box for choosing the font.
C type | Pt type | Default |
---|---|---|
char * | String | "Size:" |
The label used beside the font-size field.
C type | Pt type | Default |
---|---|---|
char * | String | "Style:" |
The label used beside the Style combo box.
C type | Pt type | Default |
---|---|---|
char * | String | "Text:" |
The label for the text color.
C type | Pt type | Default |
---|---|---|
char * | String | "TextFont09" |
The name of the initial font. This resource also reflects the currently selected font, style, quality, and size.
C type | Pt type | Default |
---|---|---|
long | Scalar | 9999 |
The maximum point size the font selector allows, with a maximum of 9999. If this resource is set to a size that is smaller than the current font size, the current size is set to the new maximum.
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 that define this character are included.
You can use this resource to display only Latin fonts (set it to 'A') or Cyrillic fonts (set it to Pk_Cyrillic_IO). You can use the value Pt_FONTSEL_ALL_SYMBOLS to override this filtering.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_BLACK |
The color of the text. See PgColor_t in the Photon Library Reference.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_WHITE |
The background color of the text. See PgColor_t in the Photon Library Reference.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of PtCallback_t structures that define the callbacks invoked when the selected font is modified.
If the widget has the Pt_CALLBACKS_ACTIVE bit set in its Pt_ARG_FLAGS resource, these callbacks are also invoked when your application changes the selected font by calling PtSetResource() or 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: