Gtk.FontSelection¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The string that represents this font |
||
r/w |
The text to display in order to demonstrate the selected font |
Child Properties¶
- Inherited:
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.FontSelection(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()[source]¶
- Returns:
a new
Gtk.FontSelection
- Return type:
Creates a new
Gtk.FontSelection
.Deprecated since version 3.2: Use
Gtk.FontChooserWidget
instead
- get_face()[source]¶
- Returns:
A
Pango.FontFace
representing the selected font group details. The returned object is owned by self and must not be modified or freed.- Return type:
Gets the
Pango.FontFace
representing the selected font group details (i.e. family, slant, weight, width, etc).New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_face_list()[source]¶
- Returns:
A
Gtk.Widget
that is part of self- Return type:
This returns the
Gtk.TreeView
which lists all styles available for the selected font. For example, “Regular”, “Bold”, etc.New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_family()[source]¶
- Returns:
A
Pango.FontFamily
representing the selected font family. Font families are a collection of font faces. The returned object is owned by self and must not be modified or freed.- Return type:
Gets the
Pango.FontFamily
representing the selected font family.New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_family_list()[source]¶
- Returns:
A
Gtk.Widget
that is part of self- Return type:
This returns the
Gtk.TreeView
that lists font families, for example, “Sans”, “Serif”, etc.New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_font_name()[source]¶
- Returns:
A string with the name of the current font, or
None
if no font is selected. You must free this string withGLib.free
().- Return type:
Gets the currently-selected font name.
Note that this can be a different string than what you set with
Gtk.FontSelection.set_font_name
(), as the font selection 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”. UsePango.FontDescription.equal
() if you want to compare two font descriptions.Deprecated since version 3.2: Use
Gtk.FontChooser
- get_preview_entry()[source]¶
- Returns:
A
Gtk.Widget
that is part of self- Return type:
This returns the
Gtk.Entry
used to display the font as a preview.New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_preview_text()[source]¶
- Returns:
the text displayed in the preview area. This string is owned by the widget and should not be modified or freed
- Return type:
Gets the text displayed in the preview area.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_size()[source]¶
- Returns:
A n integer representing the selected font size, or -1 if no font size is selected.
- Return type:
The selected font size.
New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_size_entry()[source]¶
- Returns:
A
Gtk.Widget
that is part of self- Return type:
This 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.New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- get_size_list()[source]¶
- Returns:
A
Gtk.Widget
that is part of self- Return type:
This returns the
Gtk.TreeView
used to list font sizes.New in version 2.14.
Deprecated since version 3.2: Use
Gtk.FontChooser
- set_font_name(fontname)[source]¶
- Parameters:
fontname (
str
) – a font name like “Helvetica 12” or “Times Bold 18”- Returns:
True
if the font could be set successfully;False
if no such font exists or if the self doesn’t belong to a particular screen yet.- Return type:
Sets the currently-selected font.
Note that the self needs to know the screen in which it will appear for this to work; this can be guaranteed by simply making sure that the self is inserted in a toplevel window before you call this function.
Deprecated since version 3.2: Use
Gtk.FontChooser
- set_preview_text(text)[source]¶
- Parameters:
text (
str
) – the text to display in the preview area
Sets the text displayed in the preview area. The text is used to show how the selected font looks.
Deprecated since version 3.2: Use
Gtk.FontChooser
Property Details¶
- Gtk.FontSelection.props.font_name¶
-
The string that represents this font