FontChooserWidget

The #GtkFontChooserWidget widget lists the available fonts, styles and sizes, allowing the user to select a font. It is used in the #GtkFontChooserDialog widget to provide a dialog box for selecting fonts.

To set the font which is initially selected, use gtk.font_chooser.FontChooser.setFont or gtk.font_chooser.FontChooser.setFontDesc.

To get the selected font use gtk.font_chooser.FontChooser.getFont or gtk.font_chooser.FontChooser.getFontDesc.

To change the text which is shown in the preview area, use gtk.font_chooser.FontChooser.setPreviewText.

CSS nodes

GtkFontChooserWidget has a single CSS node with name fontchooser.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GtkFontChooserWidget.

Members

Functions

self
FontChooserWidget self()

Returns this, for use in with statements.

Properties

_gType
GType _gType [@property getter]
tweakAction
gio.action.Action tweakAction [@property getter]

Get tweakAction property.

Static functions

_getGType
GType _getGType()
builder
FontChooserWidgetGidBuilder builder()

Get builder for gtk.font_chooser_widget.FontChooserWidget

Mixed In Members

From mixin FontChooserT!()

font
string font [@property getter]

Get font property.

font
string font [@property setter]

Set font property.

fontDesc
pango.font_description.FontDescription fontDesc [@property getter]

Get fontDesc property.

fontDesc
pango.font_description.FontDescription fontDesc [@property setter]

Set fontDesc property.

fontFeatures
string fontFeatures [@property getter]

Get fontFeatures property.

language
string language [@property getter]

Get language property.

language
string language [@property setter]

Set language property.

level
gtk.types.FontChooserLevel level [@property getter]

Get level property.

level
gtk.types.FontChooserLevel level [@property setter]

Set level property.

previewText
string previewText [@property getter]

Get previewText property.

previewText
string previewText [@property setter]

Set previewText property.

showPreviewEntry
bool showPreviewEntry [@property getter]

Get showPreviewEntry property.

showPreviewEntry
bool showPreviewEntry [@property setter]

Set showPreviewEntry property.

getFont
string getFont()

Gets the currently-selected font name.

getFontDesc
pango.font_description.FontDescription getFontDesc()

Gets the currently-selected font.

getFontFace
pango.font_face.FontFace getFontFace()

Gets the #PangoFontFace representing the selected font group details (i.e. family, slant, weight, width, etc).

getFontFamily
pango.font_family.FontFamily getFontFamily()

Gets the #PangoFontFamily representing the selected font family. Font families are a collection of font faces.

getFontFeatures
string getFontFeatures()

Gets the currently-selected font features.

getFontMap
pango.font_map.FontMap getFontMap()

Gets the custom font map of this font chooser widget, or null if it does not have one.

getFontSize
int getFontSize()

The selected font size.

getLanguage
string getLanguage()

Gets the language that is used for font features.

getLevel
gtk.types.FontChooserLevel getLevel()

Returns the current level of granularity for selecting fonts.

getPreviewText
string getPreviewText()

Gets the text displayed in the preview area.

getShowPreviewEntry
bool getShowPreviewEntry()

Returns whether the preview entry is shown or not.

setFilterFunc
void setFilterFunc(gtk.types.FontFilterFunc filter)

Adds a filter function that decides which fonts to display in the font chooser.

setFont
void setFont(string fontname)

Sets the currently-selected font.

setFontDesc
void setFontDesc(pango.font_description.FontDescription fontDesc)

Sets the currently-selected font from font_desc.

setFontMap
void setFontMap(pango.font_map.FontMap fontmap)

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.

setLanguage
void setLanguage(string language)

Sets the language to use for font features.

setLevel
void setLevel(gtk.types.FontChooserLevel level)

Sets the desired level of granularity for selecting fonts.

setPreviewText
void setPreviewText(string text)

Sets the text displayed in the preview area. The text is used to show how the selected font looks.

setShowPreviewEntry
void setShowPreviewEntry(bool showPreviewEntry)

Shows or hides the editable preview entry.

connectFontActivated
gulong connectFontActivated(T callback, Flag!"After" after)

Connect to FontActivated signal.

Inherited Members

From Box

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Box self()

Returns this, for use in with statements.

builder
BoxGidBuilder builder()

Get builder for gtk.box.Box

baselinePosition
gtk.types.BaselinePosition baselinePosition [@property getter]
baselinePosition
gtk.types.BaselinePosition baselinePosition [@property setter]
homogeneous
bool homogeneous [@property getter]
homogeneous
bool homogeneous [@property setter]
spacing
int spacing [@property getter]
spacing
int spacing [@property setter]
getBaselinePosition
gtk.types.BaselinePosition getBaselinePosition()

Gets the value set by gtk.box.Box.setBaselinePosition.

getCenterWidget
gtk.widget.Widget getCenterWidget()

Retrieves the center widget of the box.

getHomogeneous
bool getHomogeneous()

Returns whether the box is homogeneous (all children are the same size). See gtk.box.Box.setHomogeneous.

getSpacing
int getSpacing()

Gets the value set by gtk.box.Box.setSpacing.

packEnd
void packEnd(gtk.widget.Widget child, bool expand, bool fill, uint padding)

Adds child to box, packed with reference to the end of box. The child is packed after (away from end of) any other child packed with reference to the end of box.

packStart
void packStart(gtk.widget.Widget child, bool expand, bool fill, uint padding)

Adds child to box, packed with reference to the start of box. The child is packed after any other child packed with reference to the start of box.

queryChildPacking
void queryChildPacking(gtk.widget.Widget child, bool expand, bool fill, uint padding, gtk.types.PackType packType)

Obtains information about how child is packed into box.

reorderChild
void reorderChild(gtk.widget.Widget child, int position)

Moves child to a new position in the list of box children. The list contains widgets packed #GTK_PACK_START as well as widgets packed #GTK_PACK_END, in the order that these widgets were added to box.

setBaselinePosition
void setBaselinePosition(gtk.types.BaselinePosition position)

Sets the baseline position of a box. This affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not allocated by the parent then position is used to allocate the baseline wrt the extra space available.

setCenterWidget
void setCenterWidget(gtk.widget.Widget widget)

Sets a center widget; that is a child widget that will be centered with respect to the full width of the box, even if the children at either side take up different amounts of space.

setChildPacking
void setChildPacking(gtk.widget.Widget child, bool expand, bool fill, uint padding, gtk.types.PackType packType)

Sets the way child is packed into box.

setHomogeneous
void setHomogeneous(bool homogeneous)

Sets the #GtkBox:homogeneous property of box, controlling whether or not all children of box are given equal space in the box.

setSpacing
void setSpacing(int spacing)

Sets the #GtkBox:spacing property of box, which is the number of pixels to place between children of box.

From FontChooser

_getGType
GType _getGType()
font
string font [@property getter]

Get font property.

font
string font [@property setter]

Set font property.

fontDesc
pango.font_description.FontDescription fontDesc [@property getter]

Get fontDesc property.

fontDesc
pango.font_description.FontDescription fontDesc [@property setter]

Set fontDesc property.

fontFeatures
string fontFeatures [@property getter]

Get fontFeatures property.

language
string language [@property getter]

Get language property.

language
string language [@property setter]

Set language property.

level
gtk.types.FontChooserLevel level [@property getter]

Get level property.

level
gtk.types.FontChooserLevel level [@property setter]

Set level property.

previewText
string previewText [@property getter]

Get previewText property.

previewText
string previewText [@property setter]

Set previewText property.

showPreviewEntry
bool showPreviewEntry [@property getter]

Get showPreviewEntry property.

showPreviewEntry
bool showPreviewEntry [@property setter]

Set showPreviewEntry property.

getFont
string getFont()

Gets the currently-selected font name.

getFontDesc
pango.font_description.FontDescription getFontDesc()

Gets the currently-selected font.

getFontFace
pango.font_face.FontFace getFontFace()

Gets the #PangoFontFace representing the selected font group details (i.e. family, slant, weight, width, etc).

getFontFamily
pango.font_family.FontFamily getFontFamily()

Gets the #PangoFontFamily representing the selected font family. Font families are a collection of font faces.

getFontFeatures
string getFontFeatures()

Gets the currently-selected font features.

getFontMap
pango.font_map.FontMap getFontMap()

Gets the custom font map of this font chooser widget, or null if it does not have one.

getFontSize
int getFontSize()

The selected font size.

getLanguage
string getLanguage()

Gets the language that is used for font features.

getLevel
gtk.types.FontChooserLevel getLevel()

Returns the current level of granularity for selecting fonts.

getPreviewText
string getPreviewText()

Gets the text displayed in the preview area.

getShowPreviewEntry
bool getShowPreviewEntry()

Returns whether the preview entry is shown or not.

setFilterFunc
void setFilterFunc(gtk.types.FontFilterFunc filter)

Adds a filter function that decides which fonts to display in the font chooser.

setFont
void setFont(string fontname)

Sets the currently-selected font.

setFontDesc
void setFontDesc(pango.font_description.FontDescription fontDesc)

Sets the currently-selected font from font_desc.

setFontMap
void setFontMap(pango.font_map.FontMap fontmap)

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.

setLanguage
void setLanguage(string language)

Sets the language to use for font features.

setLevel
void setLevel(gtk.types.FontChooserLevel level)

Sets the desired level of granularity for selecting fonts.

setPreviewText
void setPreviewText(string text)

Sets the text displayed in the preview area. The text is used to show how the selected font looks.

setShowPreviewEntry
void setShowPreviewEntry(bool showPreviewEntry)

Shows or hides the editable preview entry.

connectFontActivated
gulong connectFontActivated(T callback, Flag!"After" after)

Connect to FontActivated signal.