Gtk.FontSelection - Classes - Gtk 3.0 (original) (raw)
g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Box Gtk.Box Gtk.FontSelection Gtk.FontSelection Gtk.Box->Gtk.FontSelection Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container
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 | new () |
---|---|
get_face () | |
get_face_list () | |
get_family () | |
get_family_list () | |
get_font_name () | |
get_preview_entry () | |
get_preview_text () | |
get_size () | |
get_size_entry () | |
get_size_list () | |
set_font_name (fontname) | |
set_preview_text (text) |
Virtual Methods¶
Inherited:
Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)
Properties¶
Inherited:
Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name | Type | Flags | Short Description |
---|---|---|---|
font-name | str | r/w | The string that represents this font |
preview-text | str | r/w | The text to display in order to demonstrate the selected font |
Child Properties¶
Inherited:
Style Properties¶
Inherited:
Signals¶
Inherited:
Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Fields¶
Inherited:
Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name | Type | Access | Description |
---|---|---|---|
parent_instance | Gtk.Box | r |
Class Details¶
class Gtk.FontSelection(*args, **kwargs)¶
Bases:
Abstract:
No
Structure:
Returns:
a new Gtk.FontSelection
Return type:
Creates a new Gtk.FontSelection.
Returns:
A Pango.FontFace representing the selected font group details. The returned object is owned byself 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.
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.
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.
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.
Returns:
A string with the name of the current font, or None if no font is selected. You must free this string with GLib.free().
Return type:
Gets the currently-selected font name.
Note that this can be a different string than what you set withGtk.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”. Use Pango.FontDescription.equal() if you want to compare two font descriptions.
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.
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.
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.
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.
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.
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 theself is inserted in a toplevel window before you call this function.
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.
Property Details¶
Gtk.FontSelection.props.font_name¶
Name:
font-name
Type:
Default Value:
'Sans 10'
Flags:
The string that represents this font
Gtk.FontSelection.props.preview_text¶
Name:
preview-text
Type:
Default Value:
'abcdefghijk ABCDEFGHIJK'
Flags:
The text to display in order to demonstrate the selected font