gtk.font_chooser

Module for [FontChooser] interface

Types 2

interfaceFontChooser

[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

Use [gtk.font_dialog.FontDialog] and [gtk.font_dialog_button.FontDialogButton]

instead

Methods
string font() @propertyGet `font` property. Returns: The font description as a string, e.g. "Sans Italic 12".
void font(string propval) @propertySet `font` property. Params: propval = The font description as a string, e.g. "Sans Italic 12".
pango.font_description.FontDescription fontDesc() @propertyGet `fontDesc` property. Returns: The font description as a [pango.font_description.FontDescription].
void fontDesc(pango.font_description.FontDescription propval) @propertySet `fontDesc` property. Params: propval = The font description as a [pango.font_description.FontDescription].
string fontFeatures() @propertyGet `fontFeatures` property. Returns: The selected font features.
string language() @propertyGet `language` property. Returns: The language for which the font features were selected.
void language(string propval) @propertySet `language` property. Params: propval = The language for which the font features were selected.
gtk.types.FontChooserLevel level() @propertyGet `level` property. Returns: The level of granularity to offer for selecting fonts.
void level(gtk.types.FontChooserLevel propval) @propertySet `level` property. Params: propval = The level of granularity to offer for selecting fonts.
string previewText() @propertyGet `previewText` property. Returns: The string with which to preview the font.
void previewText(string propval) @propertySet `previewText` property. Params: propval = The string with which to preview the font.
bool showPreviewEntry() @propertyGet `showPreviewEntry` property. Returns: Whether to show an entry to change the preview text.
void showPreviewEntry(bool propval) @propertySet `showPreviewEntry` property. Params: propval = Whether to show an entry to change the preview text.
string getFont()Gets the currently-selected font name.
pango.font_description.FontDescription getFontDesc()Gets the currently-selected font.
pango.font_face.FontFace getFontFace()Gets the [pango.font_face.FontFace] representing the selected font group details (i.e. family, slant, weight, width, etc).
pango.font_family.FontFamily getFontFamily()Gets the [pango.font_family.FontFamily] representing the selected font family.
string getFontFeatures()Gets the currently-selected font features.
pango.font_map.FontMap getFontMap()Gets the custom font map of this font chooser widget, or null if it does not have one. Returns: a [pango.font_map.FontMap]
int getFontSize()The selected font size. Returns: A n integer representing the selected font size, or -1 if no font size is selected.
string getLanguage()Gets the language that is used for font features. Returns: the currently selected language
gtk.types.FontChooserLevel getLevel()Returns the current level of granularity for selecting fonts. Returns: the current granularity level
string getPreviewText()Gets the text displayed in the preview area. Returns: the text displayed in the preview area
bool getShowPreviewEntry()Returns whether the preview entry is shown or not. Returns: true if the preview entry is shown or false if it is hidden.
void setFilterFunc(gtk.types.FontFilterFunc filter = null)Adds a filter function that decides which fonts to display in the font chooser.
void setFont(string fontname)Sets the currently-selected font.
void setFontDesc(pango.font_description.FontDescription fontDesc)Sets the currently-selected font from font_desc.
void setFontMap(pango.font_map.FontMap fontmap = null)Sets a custom font map to use for this font chooser widget.
void setLanguage(string language)Sets the language to use for font features.
void setLevel(gtk.types.FontChooserLevel level)Sets the desired level of granularity for selecting fonts.
void setPreviewText(string text)Sets the text displayed in the preview area.
void setShowPreviewEntry(bool showPreviewEntry)Shows or hides the editable preview entry.
gulong connectFontActivated(T)(T callback, Flag!"After" after = No.After)Connect to `FontActivated` signal.
Methods
T font(string propval)Set `font` property. Params: propval = The font description as a string, e.g. "Sans Italic 12". Returns: Builder instance for fluent chaining
T fontDesc(pango.font_description.FontDescription propval)Set `fontDesc` property. Params: propval = The font description as a [pango.font_description.FontDescription]. Returns: Builder instance for fluent chaining
T language(string propval)Set `language` property. Params: propval = The language for which the font features were selected. Returns: Builder instance for fluent chaining
T level(gtk.types.FontChooserLevel propval)Set `level` property. Params: propval = The level of granularity to offer for selecting fonts. Returns: Builder instance for fluent chaining
T previewText(string propval)Set `previewText` property. Params: propval = The string with which to preview the font. Returns: Builder instance for fluent chaining
T showPreviewEntry(bool propval)Set `showPreviewEntry` property. Params: propval = Whether to show an entry to change the preview text. Returns: Builder instance for fluent chaining