"font"ReadThe gtk.gdk.Font that is
currently selected. This property is deprecated."font-name"Read/WriteThe string that names the font"preview-text"Read/WriteThe text to display in order to demonstrate the selected
font.
gtk.FontSelection Style Propertiesgtk.Widget Style Propertiesgtk.FontSelection Child Propertiesgtk.Box Child Propertiesgtk.FontSelection Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal PrototypesDescriptionThe gtk.FontSelection
widget lists the available fonts, styles and sizes, allowing the user to
select a font. It is used in the gtk.FontSelectionDialog
widget to provide a dialog box for selecting fonts. The set_font_name()
method sets the initial font selection. The current font selection is
retrieved using the get_font_name()
method.The fontselection has a preview area that contains a gtk.Entry that
displays text using the currently selected font. The preview text can be
retrieved with the get_preview_text()
method and set with the set_preview_text()
method.Filters can be used to limit the font selections. There are 2
filters in the gtk.FontSelection
- a base filter and a user filter. The base filter cannot be changed by the
user, so this can be used when the user must choose from the restricted set
of fonts (e.g. for a terminal-type application you may want to force the
user to select a fixed-width font). The user filter can be changed or reset
by the user, by using the Reset Filter button or
changing the options on the Filter page of the
widget.Constructorgtk.FontSelectionReturns :a new fontselection widgetCreates a new gtk.FontSelection
widget.Methodsgtk.FontSelection.get_font_nameget_font_nameReturns :a string containing the selected font
nameThe get_font_name() method returns the
name of the currently selected font.gtk.FontSelection.set_font_nameset_font_namefontnamefontname :a string containing the name of a
fontReturns :True if the font could be
setThe set_font_name() method sets the
currently selected font in the fontselection using the value of
fontname. The method returns True
if the font is found and can be selected in the fontselection.gtk.FontSelection.get_preview_textget_preview_textReturns :a string containing the preview
textThe get_preview_text() method returns a
string that contains the text displayed in the preview area entry.gtk.FontSelection.set_preview_textset_preview_texttexttext :the new preview text
stringThe set_preview_text() method sets the
text to be displayed in the preview area entry using the string in
text.gtk.FontSelection.get_faceget_faceReturns :A pango.FontFace
representing the selected font group details.This method is available in PyGTK 2.14 and above.
The get_face() method gets the
pango.FontFace
representing the selected font group details (i.e. family, slant, weight, width, etc).
gtk.FontSelection.get_face_listget_face_listReturns :A
gtk.Widget
that is part of fontsel.This method is available in PyGTK 2.14 and above.
The get_face_list() method returns the
gtk.TreeView
which lists all styles available for the selected font. For example, 'Regular', 'Bold', etc.
gtk.FontSelection.get_familyget_familyReturns :A pango.FontSelection
representing the selected font family. Font families are a collection of font faces.This method is available in PyGTK 2.14 and above.
The get_family() method gets the
pango.FontSelection
representing the selected font family.
gtk.FontSelection.get_family_listget_family_listReturns :A
gtk.Widget
that is part of fontsel.This method is available in PyGTK 2.14 and above.
The get_family_list() method returns the
gtk.TreeView
that lists font families, for example, 'Sans', 'Serif', etc.
gtk.FontSelection.get_preview_entryget_preview_entryReturns :A
gtk.Widget
that is part of fontsel.This method is available in PyGTK 2.14 and above.
The get_preview_entry() method returns the
gtk.Entry
used to display the font as a preview.
gtk.FontSelection.get_sizeget_sizeReturns :A n integer representing the selected font size,
or -1 if no font size is selected. This method is available in PyGTK 2.14 and above.
The get_size() method returns the selected font size.
gtk.FontSelection.get_size_entryget_size_entryReturns :A
gtk.Widget
that is part of fontsel.This method is available in PyGTK 2.14 and above.
The get_preview_entry() method returns the
gtk.Entry
used to allow the user to edit the font number manually instead of
selecting it from the list of font sizes.
gtk.FontSelection.get_size_listget_size_listReturns :A
gtk.Widget
that is part of fontsel.This method is available in PyGTK 2.14 and above.
The get_size_list() method returns the
gtk.TreeView
used to list font sizes.