![]() |
![]() |
![]() |
![]() |
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.
A PtFontSel widget includes noneditable comboboxes that you can use to select the:
as well as:
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_LBL_FONT | char * | String | "Font:" |
Pt_ARG_FONT_LBL_QUALITY | char * | String | "Quality:" |
Pt_ARG_FONT_LBL_QUALITY_ANTIALIASED | char * | String | "Anti Aliased" |
Pt_ARG_FONT_LBL_QUALITY_PLAIN | char * | String | "Plain" |
Pt_ARG_FONT_LBL_SIZE | char * | String | "Size:" |
Pt_ARG_FONT_LBL_STYLE | char * | String | "Style:" |
Pt_ARG_FONT_LBL_STYLE_BOLD | char * | String | "Bold" |
Pt_ARG_FONT_LBL_STYLE_BOLDITALIC | char * | String | "Bold & Italic" |
Pt_ARG_FONT_LBL_STYLE_ITALIC | char * | String | "Italic" |
Pt_ARG_FONT_LBL_STYLE_PLAIN | char * | String | "Plain" |
Pt_ARG_FONT_NAME | char * | String | "TextFont09" |
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 | 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 | Flag | Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK |
Flags to modify the appearance of the widget:
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 | "Quality:" |
The label beside the combo box for choosing the quality of the font.
C type | Pt type | Default |
---|---|---|
char * | String | "Anti Aliased" |
The string used in the Quality menu for anti-aliased quality.
C type | Pt type | Default |
---|---|---|
char * | String | "Plain" |
The string used in the Quality menu for plain quality.
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 | "Bold" |
The string used in the Style menu for the bold style.
C type | Pt type | Default |
---|---|---|
char * | String | "Bold & Italic" |
The string used in the Style menu for the bold and italic style.
C type | Pt type | Default |
---|---|---|
char * | String | "Italic" |
The string used in the Style menu for the italic style.
C type | Pt type | Default |
---|---|---|
char * | String | "Plain" |
The string used in the Style menu for the plain style.
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 |
---|---|---|
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 dimension of the PtFontSel widget is fixed at 216 wide * 136 high (when the Pt_FONTSEL_SAMPLE bit of the Pt_ARG_FONT_FLAGS resource is set), or 216 wide * 58 high (when the Pt_FONTSEL_SAMPLE bit is clear).
The PtFontSel class defines the following convenience function:
![]() |
![]() |
![]() |
![]() |