Asynchronous API to present a font chooser dialog.
GtkFontDialog collects the arguments that are needed to present the dialog to the user, such as a title for the dialog and whether it should be modal.
The dialog is shown with the [methodGtk.FontDialog.choose_font] function or its variants.
See [classGtk.FontDialogButton] for a convenient control that uses GtkFontDialog and presents the results.
<group>Dialogs</group>
procedure Choose_Face
(Self : not null access Gtk_Font_Dialog_Record;
Parent : access Gtk.Window.Gtk_Window_Record'Class;
Initial_Value : access Pango.Font_Face.Pango_Font_Face_Record'Class;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Callback : Gasync_Ready_Callback)
Presents a font chooser dialog to the user. The font chooser dialog will be set up for selecting a font face. A font face represents a font family and style, but no specific font size. Since: gtk+ 4.10
the parent window
the initial value
a cancellable to cancel the operation
a callback to call when the operation is complete
function Choose_Face_Finish
(Self : not null access Gtk_Font_Dialog_Record;
Result : Glib.G_Async_Result;
Error : out Glib.Error.GError)
return Pango.Font_Face.Pango_Font_Face
Finishes the [methodGtk.FontDialog.choose_face] call. Note that this function returns a [errorGtk.DialogError.DISMISSED] error if the user cancels the dialog. Since: gtk+ 4.10
the result
the return location for a recoverable error
the selected [classPango.FontFace]. Has transfer-ownership='full'.
procedure Choose_Family
(Self : not null access Gtk_Font_Dialog_Record;
Parent : access Gtk.Window.Gtk_Window_Record'Class;
Initial_Value : access Pango.Font_Family.Pango_Font_Family_Record'Class;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Callback : Gasync_Ready_Callback)
Presents a font chooser dialog to the user. The font chooser dialog will be set up for selecting a font family. Since: gtk+ 4.10
the parent window
the initial value
a cancellable to cancel the operation
a callback to call when the operation is complete
function Choose_Family_Finish
(Self : not null access Gtk_Font_Dialog_Record;
Result : Glib.G_Async_Result;
Error : out Glib.Error.GError)
return Pango.Font_Family.Pango_Font_Family
Finishes the [methodGtk.FontDialog.choose_family] call. Note that this function returns a [errorGtk.DialogError.DISMISSED] error if the user cancels the dialog. Since: gtk+ 4.10
the result
the return location for a recoverable error
the selected [classPango.FontFamily]. Has transfer-ownership='full'.
procedure Choose_Font
(Self : not null access Gtk_Font_Dialog_Record;
Parent : access Gtk.Window.Gtk_Window_Record'Class;
Initial_Value : Pango.Font.Pango_Font_Description;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Callback : Gasync_Ready_Callback)
Presents a font chooser dialog to the user. The font chooser dialog will be set up for selecting a font. If you want to let the user select font features as well, use [methodGtk.FontDialog.choose_font_and_features] instead. Since: gtk+ 4.10
the parent window
the font to select initially
a cancellable to cancel the operation
a callback to call when the operation is complete
function Choose_Font_Finish
(Self : not null access Gtk_Font_Dialog_Record;
Result : Glib.G_Async_Result;
Error : out Glib.Error.GError)
return Pango.Font.Pango_Font_Description
Finishes the [methodGtk.FontDialog.choose_font] call. Note that this function returns a [errorGtk.DialogError.DISMISSED] error if the user cancels the dialog. Since: gtk+ 4.10
the result
the return location for a recoverable error
a [structPango.FontDescription] describing the selected font
Filter_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Filter.Gtk_Filter A filter to restrict what fonts are shown in the font chooser dialog.
Font_Map_Property : constant Glib.Properties.Property_Boxed;
Type: Pango.Font_Map 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.
type Gasync_Ready_Callback is access procedure
(Source_Object : access Glib.Object.GObject_Record'Class;
Res : Glib.G_Async_Result);
Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. Gasync_Ready_Callback callbacks from Gtask.Gtask are guaranteed to be invoked in a later iteration of the thread-default main context (see [methodGlib.MainContext.push_thread_default]) where the Gtask.Gtask was created. All other users of Gasync_Ready_Callback must likewise call it asynchronously in a later iteration of the main context. The asynchronous operation is guaranteed to have held a reference to Source_Object from the time when the *_async function was called, until after this callback returns.
the object the asynchronous operation was started with.
a Glib.G_Async_Result.
function Get_Font_Map
(Self : not null access Gtk_Font_Dialog_Record)
return Pango.Font_Map.Pango_Font_Map
Returns the fontmap from which fonts are selected, or NULL for the default fontmap. Since: gtk+ 4.10
the fontmap. Has transfer-ownership='none'.
function Get_Language
(Self : not null access Gtk_Font_Dialog_Record)
return Pango.Language.Pango_Language
Returns the language for which font features are applied. Since: gtk+ 4.10
the language for font features. Has transfer-ownership='full'.
function Get_Modal
(Self : not null access Gtk_Font_Dialog_Record) return Boolean
Returns whether the font chooser dialog blocks interaction with the parent window while it is presented. Since: gtk+ 4.10
true if the font chooser dialog is modal
function Get_Title
(Self : not null access Gtk_Font_Dialog_Record) return UTF8_String
Returns the title that will be shown on the font chooser dialog. Since: gtk+ 4.10
the title
function Get_Type return Glib.GType
type Gtk_Font_Dialog is access all Gtk_Font_Dialog_Record'Class;
function Gtk_Font_Dialog_New return Gtk_Font_Dialog
Creates a new GtkFontDialog object. Since: gtk+ 4.10
type Gtk_Font_Dialog_Record is new GObject_Record with null record;
procedure Gtk_New (Self : out Gtk_Font_Dialog)
Creates a new GtkFontDialog object. Since: gtk+ 4.10 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize
(Self : not null access Gtk_Font_Dialog_Record'Class)
Creates a new GtkFontDialog object. Since: gtk+ 4.10 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
Language_Property : constant Glib.Properties.Property_Boxed;
Type: Pango.Language The language for which the font features are selected.
Modal_Property : constant Glib.Properties.Property_Boolean;
Whether the font chooser dialog is modal.
procedure Set_Font_Map
(Self : not null access Gtk_Font_Dialog_Record;
Fontmap : access Pango.Font_Map.Pango_Font_Map_Record'Class)
Sets the fontmap from which fonts are selected. If Fontmap is NULL, the default fontmap is used. Since: gtk+ 4.10
the fontmap
procedure Set_Language
(Self : not null access Gtk_Font_Dialog_Record;
Language : Pango.Language.Pango_Language)
Sets the language for which font features are applied. Since: gtk+ 4.10
the language for font features
procedure Set_Modal
(Self : not null access Gtk_Font_Dialog_Record;
Modal : Boolean)
Sets whether the font chooser dialog blocks interaction with the parent window while it is presented. Since: gtk+ 4.10
the new value
procedure Set_Title
(Self : not null access Gtk_Font_Dialog_Record;
Title : UTF8_String)
Sets the title that will be shown on the font chooser dialog. Since: gtk+ 4.10
the new title
Title_Property : constant Glib.Properties.Property_String;
A title that may be shown on the font chooser dialog that is presented by [methodGtk.FontDialog.choose_font].