instead
gtk.font_chooser_mixin
Module for [FontChooser] interface mixin
Templates 2
[gtk.font_chooser.FontChooser] is an interface that can be implemented by widgets for choosing fonts.
In GTK, the main objects that implement this interface are [gtk.font_chooser_widget.FontChooserWidget], [gtk.font_chooser_dialog.FontChooserDialog] and [gtk.font_button.FontButton].
Deprecated
Get font property.
Returns
Deprecated
Set font property.
Parameters
propval | The font description as a string, e.g. "Sans Italic 12". |
Deprecated
Get fontDesc property.
Returns
Deprecated
Set fontDesc property.
Parameters
propval | The font description as a [pango.font_description.FontDescription]. |
Deprecated
Get fontFeatures property.
Returns
The format of the string is compatible with CSS and with Pango attributes.
Deprecated
Get language property.
Returns
Deprecated
Set language property.
Parameters
propval | The language for which the font features were selected. |
Deprecated
Get level property.
Returns
Deprecated
Set level property.
Parameters
propval | The level of granularity to offer for selecting fonts. |
Deprecated
Get previewText property.
Returns
Deprecated
Set previewText property.
Parameters
propval | The string with which to preview the font. |
Deprecated
Get showPreviewEntry property.
Returns
Deprecated
Set showPreviewEntry property.
Parameters
propval | Whether to show an entry to change the preview text. |
Deprecated
Gets the currently-selected font name.
Note that this can be a different string than what you set with [gtk.font_chooser.FontChooser.setFont], as the font chooser widget may normalize font names and thus return a string with a different structure. For example, “Helvetica Italic Bold 12” could be normalized to “Helvetica Bold Italic 12”.
Use [pango.font_description.FontDescription.equal] if you want to compare two font descriptions.
Returns
of the current font
Deprecated
instead
Gets the currently-selected font.
Note that this can be a different string than what you set with [gtk.font_chooser.FontChooser.setFont], as the font chooser widget may normalize font names and thus return a string with a different structure. For example, “Helvetica Italic Bold 12” could be normalized to “Helvetica Bold Italic 12”.
Use [pango.font_description.FontDescription.equal] if you want to compare two font descriptions.
Returns
current font
Deprecated
instead
Gets the [pango.font_face.FontFace] representing the selected font group details (i.e. family, slant, weight, width, etc).
If the selected font is not installed, returns null.
Returns
selected font group details
Deprecated
instead
Gets the [pango.font_family.FontFamily] representing the selected font family.
Font families are a collection of font faces.
If the selected font is not installed, returns null.
Returns
selected font family
Deprecated
instead
Gets the currently-selected font features.
The format of the returned string is compatible with the
CSS font-feature-settings property.It can be passed to [pango.attr_font_features.AttrFontFeatures.new_].
Returns
Deprecated
instead
Gets the custom font map of this font chooser widget, or null if it does not have one.
Returns
Deprecated
instead
The selected font size.
Returns
or -1 if no font size is selected.
Deprecated
instead
Gets the language that is used for font features.
Returns
Deprecated
instead
Returns the current level of granularity for selecting fonts.
Returns
Deprecated
instead
Gets the text displayed in the preview area.
Returns
Deprecated
instead
Returns whether the preview entry is shown or not.
Returns
Deprecated
instead
Adds a filter function that decides which fonts to display in the font chooser.
Parameters
filter | a [gtk.types.FontFilterFunc] |
Deprecated
instead
Sets the currently-selected font.
Parameters
fontname | a font name like “Helvetica 12” or “Times Bold 18” |
Deprecated
instead
Sets the currently-selected font from font_desc.
Parameters
fontDesc | a [pango.font_description.FontDescription] |
Deprecated
instead
Sets a custom font map to use for this font chooser widget.
A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.
FcConfig *config;
PangoFontMap *fontmap;
config = FcInitLoadConfigAndFonts ();
FcConfigAppFontAddFile (config, my_app_font_file);
fontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT);
pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
gtk_font_chooser_set_font_map (font_chooser, fontmap);Note that other GTK widgets will only be able to use the application-specific font if it is present in the font map they use:
context = gtk_widget_get_pango_context (label);
pango_context_set_font_map (context, fontmap);Parameters
fontmap | a [pango.font_map.FontMap] |
Deprecated
instead
Sets the language to use for font features.
Parameters
language | a language |
Deprecated
instead
Sets the desired level of granularity for selecting fonts.
Parameters
level | the desired level of granularity |
Deprecated
instead
Sets the text displayed in the preview area.
The text is used to show how the selected font looks.
Parameters
text | the text to display in the preview area |
Deprecated
instead
Shows or hides the editable preview entry.
Parameters
showPreviewEntry | whether to show the editable preview entry or not |
Deprecated
instead
Connect to FontActivated signal.
Emitted when a font is activated.
This usually happens when the user double clicks an item, or an item is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
Parameters
callback | signal callback delegate or function to connect void callback(string fontname, gtk.font_chooser.FontChooser fontChooser) fontname the font name (optional) fontChooser the instance the signal is connected to (optional) |
after | Yes.After to execute callback after default handler, No.After to execute before (default) |
Returns
Deprecated
Set font property.
Parameters
propval | The font description as a string, e.g. "Sans Italic 12". |
Returns
Deprecated
Set fontDesc property.
Parameters
propval | The font description as a [pango.font_description.FontDescription]. |
Returns
Deprecated
Set language property.
Parameters
propval | The language for which the font features were selected. |
Returns
Deprecated
Set level property.
Parameters
propval | The level of granularity to offer for selecting fonts. |
Returns
Deprecated
Set previewText property.
Parameters
propval | The string with which to preview the font. |
Returns
Deprecated
Set showPreviewEntry property.
Parameters
propval | Whether to show an entry to change the preview text. |