This widget provides a nice way for the user of your application to select fonts. It first searches on your system for the list of fonts available, and displays a set of boxes to select them based on their name, their weight, their size, etc. This widget is provided in two forms, one widget that can be embedded in any container, a Gtk_Font_Selection, whereas the other one comes directly in its own separate window (to be popped up as a dialog).
Some filters can be applied to the widget, when you want the user to select only a font only among a specific subset (like bitmap or true-type fonts for instance). There are two kinds of filters: a base filter, set in your application and that the user can not change; a user filter that can be modified interactively by the user.
<screenshot>gtk-fontsel</screenshot> <group>Selectors</group> <testgtk>create_font_selection.adb</testgtk>
function "+"
(Widget : access Gtk_Font_Selection_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Font_Selection_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Font_Selection
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Font_Selection
Font_Name_Property : constant Glib.Properties.Property_String;
function Get_Face_List
(Fontsel : not null access Gtk_Font_Selection_Record)
return Gtk.Widget.Gtk_Widget
This returns the Gtk.Tree_View.Gtk_Tree_View which lists all styles available for the selected font. For example, "Regular", "Bold", etc. Since: gtk+ 2.14 Deprecated since 3.2, 1
A Gtk.Widget.Gtk_Widget that is part of Fontsel
function Get_Family_List
(Fontsel : not null access Gtk_Font_Selection_Record)
return Gtk.Widget.Gtk_Widget
This returns the Gtk.Tree_View.Gtk_Tree_View that lists font families, for example, "Sans", "Serif", etc. Since: gtk+ 2.14 Deprecated since 3.2, 1
A Gtk.Widget.Gtk_Widget that is part of Fontsel
function Get_Font_Name
(Fontsel : not null access Gtk_Font_Selection_Record)
return UTF8_String
Gets the currently-selected font name. Note that this can be a different string than what you set with Gtk.Font_Selection.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.Font.Equal if you want to compare two font descriptions. Deprecated since 3.2, 1
A string with the name of the current font, or null if no font is selected. You must free this string with g_free.
function Get_Orientation
(Self : not null access Gtk_Font_Selection_Record)
return Gtk.Enums.Gtk_Orientation
function Get_Preview_Entry
(Fontsel : not null access Gtk_Font_Selection_Record)
return Gtk.Widget.Gtk_Widget
This returns the Gtk.GEntry.Gtk_Entry used to display the font as a preview. Since: gtk+ 2.14 Deprecated since 3.2, 1
A Gtk.Widget.Gtk_Widget that is part of Fontsel
function Get_Preview_Text
(Fontsel : not null access Gtk_Font_Selection_Record)
return UTF8_String
Gets the text displayed in the preview area. Deprecated since 3.2, 1
the text displayed in the preview area. This string is owned by the widget and should not be modified or freed
function Get_Size
(Fontsel : not null access Gtk_Font_Selection_Record) return Glib.Gint
The selected font size. Since: gtk+ 2.14 Deprecated since 3.2, 1
A n integer representing the selected font size, or -1 if no font size is selected.
function Get_Size_Entry
(Fontsel : not null access Gtk_Font_Selection_Record)
return Gtk.Widget.Gtk_Widget
This returns the Gtk.GEntry.Gtk_Entry used to allow the user to edit the font number manually instead of selecting it from the list of font sizes. Since: gtk+ 2.14 Deprecated since 3.2, 1
A Gtk.Widget.Gtk_Widget that is part of Fontsel
function Get_Size_List
(Fontsel : not null access Gtk_Font_Selection_Record)
return Gtk.Widget.Gtk_Widget
This returns the Gtk.Tree_View.Gtk_Tree_View used to list font sizes. Since: gtk+ 2.14 Deprecated since 3.2, 1
A Gtk.Widget.Gtk_Widget that is part of Fontsel
function Get_Type return Glib.GType
type Gtk_Font_Selection is access all Gtk_Font_Selection_Record'Class;
function Gtk_Font_Selection_New return Gtk_Font_Selection
Creates a new Gtk.Font_Selection.Gtk_Font_Selection.
type Gtk_Font_Selection_Record is new Gtk_Box_Record with null record;
procedure Gtk_New (Fontsel : out Gtk_Font_Selection)
Creates a new Gtk.Font_Selection.Gtk_Font_Selection. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Font_Selection_Record, Gtk_Font_Selection);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Font_Selection_Record, Gtk_Font_Selection);
procedure Initialize
(Fontsel : not null access Gtk_Font_Selection_Record'Class)
Creates a new Gtk.Font_Selection.Gtk_Font_Selection. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
Preview_Text_Property : constant Glib.Properties.Property_String;
function Set_Font_Name
(Fontsel : not null access Gtk_Font_Selection_Record;
Fontname : UTF8_String) return Boolean
Sets the currently-selected font. Note that the Fontsel needs to know the screen in which it will appear for this to work; this can be guaranteed by simply making sure that the Fontsel is inserted in a toplevel window before you call this function. Deprecated since 3.2, 1
a font name like "Helvetica 12" or "Times Bold 18"
True if the font could be set successfully; False if no such font exists or if the Fontsel doesn't belong to a particular screen yet.
procedure Set_Orientation
(Self : not null access Gtk_Font_Selection_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
procedure Set_Preview_Text
(Fontsel : not null access Gtk_Font_Selection_Record;
Text : UTF8_String)
Sets the text displayed in the preview area. The Text is used to show how the selected font looks. Deprecated since 3.2, 1
the text to display in the preview area