Gtk.Font_Selection

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

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
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Font_Selection_Record'Class)
return Gtk.Orientable.Gtk_Orientable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Font_Selection
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Font_Selection
Parameters
Interf
Return Value

Font_Name_Property

Font_Name_Property : constant Glib.Properties.Property_String;

Get_Face_List

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

Parameters
Fontsel
Return Value

A Gtk.Widget.Gtk_Widget that is part of Fontsel

Get_Family_List

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

Parameters
Fontsel
Return Value

A Gtk.Widget.Gtk_Widget that is part of Fontsel

Get_Font_Name

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

Parameters
Fontsel
Return Value

A string with the name of the current font, or null if no font is selected. You must free this string with g_free.

Get_Orientation

function Get_Orientation
   (Self : not null access Gtk_Font_Selection_Record)
    return Gtk.Enums.Gtk_Orientation
Parameters
Self
Return Value

Get_Preview_Entry

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

Parameters
Fontsel
Return Value

A Gtk.Widget.Gtk_Widget that is part of Fontsel

Get_Preview_Text

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

Parameters
Fontsel
Return Value

the text displayed in the preview area. This string is owned by the widget and should not be modified or freed

Get_Size

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

Parameters
Fontsel
Return Value

A n integer representing the selected font size, or -1 if no font size is selected.

Get_Size_Entry

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

Parameters
Fontsel
Return Value

A Gtk.Widget.Gtk_Widget that is part of Fontsel

Get_Size_List

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

Parameters
Fontsel
Return Value

A Gtk.Widget.Gtk_Widget that is part of Fontsel

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_Font_Selection

type Gtk_Font_Selection is access all Gtk_Font_Selection_Record'Class;

Gtk_Font_Selection_New

function Gtk_Font_Selection_New return Gtk_Font_Selection

Creates a new Gtk.Font_Selection.Gtk_Font_Selection.

Return Value

Gtk_Font_Selection_Record

type Gtk_Font_Selection_Record is new Gtk_Box_Record with null record;

Gtk_New

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.

Parameters
Fontsel

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Font_Selection_Record, Gtk_Font_Selection);

Implements_Gtk_Orientable

package Implements_Gtk_Orientable is new Glib.Types.Implements
  (Gtk.Orientable.Gtk_Orientable, Gtk_Font_Selection_Record, Gtk_Font_Selection);

Initialize

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.

Parameters
Fontsel

Preview_Text_Property

Preview_Text_Property : constant Glib.Properties.Property_String;

Set_Font_Name

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

Parameters
Fontsel
Fontname

a font name like "Helvetica 12" or "Times Bold 18"

Return Value

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.

Set_Orientation

procedure Set_Orientation
   (Self        : not null access Gtk_Font_Selection_Record;
    Orientation : Gtk.Enums.Gtk_Orientation)
Parameters
Self
Orientation

Set_Preview_Text

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

Parameters
Fontsel
Text

the text to display in the preview area