Gtk.FontDialog¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.FontDialog(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
GtkFontDialog
object collects the arguments that are needed to present a font chooser dialog to the user, such as a title for the dialog and whether it should be modal.The dialog is shown with the [method`Gtk`.FontDialog.choose_font] function or its variants. This API follows the GIO async pattern, and the result can be obtained by calling the corresponding finish function, such as [method`Gtk`.FontDialog.choose_font_finish].
See [class`Gtk`.FontDialogButton] for a convenient control that uses
GtkFontDialog
and presents the results.New in version 4.10.
- classmethod new()[source]¶
- Returns:
the new
GtkFontDialog
- Return type:
Creates a new
GtkFontDialog
object.New in version 4.10.
- choose_face(parent, initial_value, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parentGtkWindow
initial_value (
Pango.FontFace
orNone
) – the initial valuecancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
This function initiates a font selection operation by presenting a dialog to the user for selecting a font face (i.e. a font family and style, but not a specific font size).
The callback will be called when the dialog is dismissed. It should call [method`Gtk`.FontDialog.choose_face_finish] to obtain the result.
New in version 4.10.
- choose_face_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – aGAsyncResult
- Raises:
- Returns:
the selected font face
- Return type:
Finishes the [method`Gtk`.FontDialog.choose_face] call and returns the resulting font face.
New in version 4.10.
- choose_family(parent, initial_value, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parentGtkWindow
initial_value (
Pango.FontFamily
orNone
) – the initial valuecancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
This function initiates a font selection operation by presenting a dialog to the user for selecting a font family.
The callback will be called when the dialog is dismissed. It should call [method`Gtk`.FontDialog.choose_family_finish] to obtain the result.
New in version 4.10.
- choose_family_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – aGAsyncResult
- Raises:
- Returns:
the selected family
- Return type:
Finishes the [method`Gtk`.FontDialog.choose_family] call and returns the resulting family.
This function never returns an error. If the operation is not finished successfully, the value passed as initial_value to [method`Gtk`.FontDialog.choose_family] is returned.
New in version 4.10.
- choose_font(parent, initial_value, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parentGtkWindow
initial_value (
Pango.FontDescription
orNone
) – the font to select initiallycancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
This function initiates a font selection operation by presenting a dialog to the user for selecting a font.
The callback will be called when the dialog is dismissed. It should call [method`Gtk`.FontDialog.choose_font_finish] to obtain the result.
If you want to let the user select font features as well, use [method`Gtk`.FontDialog.choose_font_and_features] instead.
New in version 4.10.
- choose_font_and_features(parent, initial_value, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parentGtkWindow
initial_value (
Pango.FontDescription
orNone
) – the font to select initiallycancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
This function initiates a font selection operation by presenting a dialog to the user for selecting a font and font features.
Font features affect how the font is rendered, for example enabling glyph variants or ligatures.
The callback will be called when the dialog is dismissed. It should call [method`Gtk`.FontDialog.choose_font_and_features_finish] to obtain the result.
New in version 4.10.
- choose_font_and_features_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – aGAsyncResult
- Raises:
- Returns:
TRUE
if a font was selected. OtherwiseFALSE
is returned and error is set- font_desc:
return location for font description
- font_features:
return location for font features
- language:
return location for the language
- Return type:
(
bool
, font_desc:Pango.FontDescription
, font_features:str
, language:Pango.Language
)
Finishes the [method`Gtk`.FontDialog.choose_font_and_features] call and returns the resulting font description and font features.
New in version 4.10.
- choose_font_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – aGAsyncResult
- Raises:
- Returns:
the selected font
- Return type:
Finishes the [method`Gtk`.FontDialog.choose_font] call and returns the resulting font description.
New in version 4.10.
- get_filter()[source]¶
- Returns:
the filter
- Return type:
Gtk.Filter
orNone
Returns the filter that decides which fonts to display in the font chooser dialog.
New in version 4.10.
- get_font_map()[source]¶
- Returns:
the fontmap
- Return type:
Returns the fontmap from which fonts are selected, or
NULL
for the default fontmap.New in version 4.10.
- get_language()[source]¶
- Returns:
the language for font features
- Return type:
Returns the language for which font features are applied.
New in version 4.10.
- get_modal()[source]¶
- Returns:
TRUE
if the font chooser dialog is modal- Return type:
Returns whether the font chooser dialog blocks interaction with the parent window while it is presented.
New in version 4.10.
- get_title()[source]¶
- Returns:
the title
- Return type:
Returns the title that will be shown on the font chooser dialog.
New in version 4.10.
- set_filter(filter)[source]¶
- Parameters:
filter (
Gtk.Filter
orNone
) – aGtkFilter
Adds a filter that decides which fonts to display in the font chooser dialog.
The
GtkFilter
must be able to handle bothPangoFontFamily
andPangoFontFace
objects.New in version 4.10.
- set_font_map(fontmap)[source]¶
- Parameters:
fontmap (
Pango.FontMap
orNone
) – the fontmap
Sets the fontmap from which fonts are selected.
If fontmap is
NULL
, the default fontmap is used.New in version 4.10.
- set_language(language)[source]¶
- Parameters:
language (
Pango.Language
) – the language for font features
Sets the language for which font features are applied.
New in version 4.10.
Property Details¶
- Gtk.FontDialog.props.filter¶
- Name:
filter
- Type:
- Default Value:
- Flags:
Sets a filter to restrict what fonts are shown in the font chooser dialog.
New in version 4.10.
- Gtk.FontDialog.props.font_map¶
- Name:
font-map
- Type:
- Default Value:
- Flags:
Sets a custom font map to select fonts from.
A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.
New in version 4.10.
- Gtk.FontDialog.props.language¶
- Name:
language
- Type:
- Default Value:
- Flags:
The language for which the font features are selected.
New in version 4.10.
- Gtk.FontDialog.props.modal¶
- Name:
modal
- Type:
- Default Value:
- Flags:
Whether the font chooser dialog is modal.
New in version 4.10.