The Gtk.Font_Button.Gtk_Font_Button is a button which displays the currently selected font an allows to open a font chooser dialog to change the font. It is suitable widget for selecting a font in a preference dialog.
# CSS nodes
GtkFontButton has a single CSS node with name button and style class .font.
function "+"
(Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Actionable.Gtk_Actionable
function "+"
(Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Activatable.Gtk_Activatable
function "+"
(Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Font_Chooser.Gtk_Font_Chooser
function "-"
(Interf : Gtk.Actionable.Gtk_Actionable)
return Gtk_Font_Button
function "-"
(Interf : Gtk.Activatable.Gtk_Activatable)
return Gtk_Font_Button
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Font_Button
function "-"
(Interf : Gtk.Font_Chooser.Gtk_Font_Chooser)
return Gtk_Font_Button
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Font_Button_Void is not null access procedure
(Self : access Gtk_Font_Button_Record'Class);
procedure Do_Set_Related_Action
(Self : not null access Gtk_Font_Button_Record;
Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Font_Name_Property : constant Glib.Properties.Property_String;
The name of the currently selected font.
function Get_Action_Name
(Self : not null access Gtk_Font_Button_Record) return UTF8_String
function Get_Action_Target_Value
(Self : not null access Gtk_Font_Button_Record)
return Glib.Variant.Gvariant
function Get_Font
(Self : not null access Gtk_Font_Button_Record) return UTF8_String
function Get_Font_Desc
(Self : not null access Gtk_Font_Button_Record)
return Pango.Font.Pango_Font_Description
function Get_Font_Face
(Self : not null access Gtk_Font_Button_Record)
return Pango.Font_Face.Pango_Font_Face
function Get_Font_Family
(Self : not null access Gtk_Font_Button_Record)
return Pango.Font_Family.Pango_Font_Family
function Get_Font_Features
(Self : not null access Gtk_Font_Button_Record) return UTF8_String
function Get_Font_Map
(Self : not null access Gtk_Font_Button_Record)
return Pango.Font_Map.Pango_Font_Map
function Get_Font_Name
(Font_Button : not null access Gtk_Font_Button_Record)
return UTF8_String
Retrieves the name of the currently selected font. This name includes style and size information as well. If you want to render something with the font, use this string with Pango.Font.From_String . If you're interested in peeking certain values (family name, style, size, weight) just query these properties from the Pango.Font.Pango_Font_Description object. Since: gtk+ 2.4 Deprecated since 3.22, 1
an internal copy of the font name which must not be freed.
function Get_Font_Size
(Self : not null access Gtk_Font_Button_Record) return Glib.Gint
function Get_Language
(Self : not null access Gtk_Font_Button_Record) return UTF8_String
function Get_Level
(Self : not null access Gtk_Font_Button_Record)
return Gtk.Font_Chooser.Gtk_Font_Chooser_Level
function Get_Preview_Text
(Self : not null access Gtk_Font_Button_Record) return UTF8_String
function Get_Related_Action
(Self : not null access Gtk_Font_Button_Record)
return Gtk.Action.Gtk_Action
function Get_Show_Preview_Entry
(Self : not null access Gtk_Font_Button_Record) return Boolean
function Get_Show_Size
(Font_Button : not null access Gtk_Font_Button_Record) return Boolean
Returns whether the font size will be shown in the label. Since: gtk+ 2.4
whether the font size will be shown in the label.
function Get_Show_Style
(Font_Button : not null access Gtk_Font_Button_Record) return Boolean
Returns whether the name of the font style will be shown in the label. Since: gtk+ 2.4
whether the font style will be shown in the label.
function Get_Title
(Font_Button : not null access Gtk_Font_Button_Record)
return UTF8_String
Retrieves the title of the font chooser dialog. Since: gtk+ 2.4
an internal copy of the title string which must not be freed.
function Get_Type return Glib.GType
function Get_Use_Action_Appearance
(Self : not null access Gtk_Font_Button_Record) return Boolean
function Get_Use_Font
(Font_Button : not null access Gtk_Font_Button_Record) return Boolean
Returns whether the selected font is used in the label. Since: gtk+ 2.4
whether the selected font is used in the label.
function Get_Use_Size
(Font_Button : not null access Gtk_Font_Button_Record) return Boolean
Returns whether the selected size is used in the label. Since: gtk+ 2.4
whether the selected size is used in the label.
type Gtk_Font_Button is access all Gtk_Font_Button_Record'Class;
function Gtk_Font_Button_New return Gtk_Font_Button
Creates a new font picker widget. Since: gtk+ 2.4
function Gtk_Font_Button_New_With_Font
(Fontname : UTF8_String) return Gtk_Font_Button
Creates a new font picker widget. Since: gtk+ 2.4
Name of font to display in font chooser dialog
type Gtk_Font_Button_Record is new Gtk_Button_Record with null record;
type Gtk_Font_Filter_Func is access function
(Family : not null access Pango.Font_Family.Pango_Font_Family_Record'Class;
Face : not null access Pango.Font_Face.Pango_Font_Face_Record'Class)
return Boolean;
The type of function that is used for deciding what fonts get shown in a Gtk.Font_Chooser.Gtk_Font_Chooser. See Gtk.Font_Chooser.Set_Filter_Func.
a Pango.Font_Family.Pango_Font_Family
a Pango.Font_Face.Pango_Font_Face belonging to Family
True if the font should be displayed
procedure Gtk_New (Font_Button : out Gtk_Font_Button)
Creates a new font picker widget. Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Gtk_New_With_Font
(Font_Button : out Gtk_Font_Button;
Fontname : UTF8_String)
Creates a new font picker widget. Since: gtk+ 2.4 Initialize_With_Font does nothing if the object was already created with another call to Initialize* or G_New.
Name of font to display in font chooser dialog
package Implements_Gtk_Actionable is new Glib.Types.Implements
(Gtk.Actionable.Gtk_Actionable, Gtk_Font_Button_Record, Gtk_Font_Button);
package Implements_Gtk_Activatable is new Glib.Types.Implements
(Gtk.Activatable.Gtk_Activatable, Gtk_Font_Button_Record, Gtk_Font_Button);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Font_Button_Record, Gtk_Font_Button);
package Implements_Gtk_Font_Chooser is new Glib.Types.Implements
(Gtk.Font_Chooser.Gtk_Font_Chooser, Gtk_Font_Button_Record, Gtk_Font_Button);
procedure Initialize
(Font_Button : not null access Gtk_Font_Button_Record'Class)
Creates a new font picker widget. Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize_With_Font
(Font_Button : not null access Gtk_Font_Button_Record'Class;
Fontname : UTF8_String)
Creates a new font picker widget. Since: gtk+ 2.4 Initialize_With_Font does nothing if the object was already created with another call to Initialize* or G_New.
Name of font to display in font chooser dialog
procedure On_Font_Set
(Self : not null access Gtk_Font_Button_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
The ::font-set signal is emitted when the user selects a font. When handling this signal, use Gtk.Font_Chooser.Get_Font to find out which font was just selected.
Note that this signal is only emitted when the user changes the font. If you need to react to programmatic font changes as well, use the notify::font signal.
procedure On_Font_Set
(Self : not null access Gtk_Font_Button_Record;
Call : Cb_Gtk_Font_Button_Void;
After : Boolean := False)
The ::font-set signal is emitted when the user selects a font. When handling this signal, use Gtk.Font_Chooser.Get_Font to find out which font was just selected.
Note that this signal is only emitted when the user changes the font. If you need to react to programmatic font changes as well, use the notify::font signal.
procedure Set_Action_Name
(Self : not null access Gtk_Font_Button_Record;
Action_Name : UTF8_String := "")
procedure Set_Action_Target_Value
(Self : not null access Gtk_Font_Button_Record;
Target_Value : Glib.Variant.Gvariant)
procedure Set_Detailed_Action_Name
(Self : not null access Gtk_Font_Button_Record;
Detailed_Action_Name : UTF8_String)
procedure Set_Filter_Func
(Self : not null access Gtk_Font_Button_Record;
Filter : Gtk_Font_Filter_Func)
Adds a filter function that decides which fonts to display in the font chooser. Since: gtk+ 3.2
a Gtk_Font_Filter_Func, or null
procedure Set_Font
(Self : not null access Gtk_Font_Button_Record;
Fontname : UTF8_String)
procedure Set_Font_Desc
(Self : not null access Gtk_Font_Button_Record;
Font_Desc : Pango.Font.Pango_Font_Description)
procedure Set_Font_Map
(Self : not null access Gtk_Font_Button_Record;
Fontmap : access Pango.Font_Map.Pango_Font_Map_Record'Class)
function Set_Font_Name
(Font_Button : not null access Gtk_Font_Button_Record;
Fontname : UTF8_String) return Boolean
Sets or updates the currently-displayed font in font picker dialog. Since: gtk+ 2.4 Deprecated since 3.22, 1
Name of font to display in font chooser dialog
True
procedure Set_Language
(Self : not null access Gtk_Font_Button_Record;
Language : UTF8_String)
procedure Set_Level
(Self : not null access Gtk_Font_Button_Record;
Level : Gtk.Font_Chooser.Gtk_Font_Chooser_Level)
procedure Set_Preview_Text
(Self : not null access Gtk_Font_Button_Record;
Text : UTF8_String)
procedure Set_Related_Action
(Self : not null access Gtk_Font_Button_Record;
Action : not null access Gtk.Action.Gtk_Action_Record'Class)
procedure Set_Show_Preview_Entry
(Self : not null access Gtk_Font_Button_Record;
Show_Preview_Entry : Boolean)
procedure Set_Show_Size
(Font_Button : not null access Gtk_Font_Button_Record;
Show_Size : Boolean)
If Show_Size is True, the font size will be displayed along with the name of the selected font. Since: gtk+ 2.4
True if font size should be displayed in dialog.
procedure Set_Show_Style
(Font_Button : not null access Gtk_Font_Button_Record;
Show_Style : Boolean)
If Show_Style is True, the font style will be displayed along with name of the selected font. Since: gtk+ 2.4
True if font style should be displayed in label.
procedure Set_Title
(Font_Button : not null access Gtk_Font_Button_Record;
Title : UTF8_String)
Sets the title for the font chooser dialog. Since: gtk+ 2.4
a string containing the font chooser dialog title
procedure Set_Use_Action_Appearance
(Self : not null access Gtk_Font_Button_Record;
Use_Appearance : Boolean)
procedure Set_Use_Font
(Font_Button : not null access Gtk_Font_Button_Record;
Use_Font : Boolean)
If Use_Font is True, the font name will be written using the selected font. Since: gtk+ 2.4
If True, font name will be written using font chosen.
procedure Set_Use_Size
(Font_Button : not null access Gtk_Font_Button_Record;
Use_Size : Boolean)
If Use_Size is True, the font name will be written using the selected size. Since: gtk+ 2.4
If True, font name will be written using the selected size.
Show_Size_Property : constant Glib.Properties.Property_Boolean;
If this property is set to True, the selected font size will be shown in the label. For a more WYSIWYG way to show the selected size, see the ::use-size property.
Show_Style_Property : constant Glib.Properties.Property_Boolean;
If this property is set to True, the name of the selected font style will be shown in the label. For a more WYSIWYG way to show the selected style, see the ::use-font property.
Signal_Font_Set : constant Glib.Signal_Name := "font-set";
The ::font-set signal is emitted when the user selects a font. When handling this signal, use Gtk.Font_Chooser.Get_Font to find out which font was just selected.
Note that this signal is only emitted when the user changes the font. If you need to react to programmatic font changes as well, use the notify::font signal.
procedure Sync_Action_Properties
(Self : not null access Gtk_Font_Button_Record;
Action : access Gtk.Action.Gtk_Action_Record'Class)
Title_Property : constant Glib.Properties.Property_String;
The title of the font chooser dialog.
Use_Font_Property : constant Glib.Properties.Property_Boolean;
If this property is set to True, the label will be drawn in the selected font.
Use_Size_Property : constant Glib.Properties.Property_Boolean;
If this property is set to True, the label will be drawn with the selected font size.