Gtk.Font_Button

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

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

"+"

function "+"
  (Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Activatable.Gtk_Activatable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Font_Button_Record'Class)
return Gtk.Font_Chooser.Gtk_Font_Chooser
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Actionable.Gtk_Actionable)
return Gtk_Font_Button
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Activatable.Gtk_Activatable)
return Gtk_Font_Button
Parameters
Interf
Return Value

"-"

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

"-"

function "-"
  (Interf : Gtk.Font_Chooser.Gtk_Font_Chooser)
return Gtk_Font_Button
Parameters
Interf
Return Value

Cb_GObject_Void

type Cb_GObject_Void is not null access procedure
  (Self : access Glib.Object.GObject_Record'Class);
Parameters
Self

Cb_Gtk_Font_Button_Void

type Cb_Gtk_Font_Button_Void is not null access procedure
  (Self : access Gtk_Font_Button_Record'Class);
Parameters
Self

Do_Set_Related_Action

procedure Do_Set_Related_Action
   (Self   : not null access Gtk_Font_Button_Record;
    Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Font_Name_Property

Font_Name_Property : constant Glib.Properties.Property_String;

The name of the currently selected font.

Get_Action_Name

function Get_Action_Name
   (Self : not null access Gtk_Font_Button_Record) return UTF8_String
Parameters
Self
Return Value

Get_Action_Target_Value

function Get_Action_Target_Value
   (Self : not null access Gtk_Font_Button_Record)
    return Glib.Variant.Gvariant
Parameters
Self
Return Value

Get_Font

function Get_Font
   (Self : not null access Gtk_Font_Button_Record) return UTF8_String
Parameters
Self
Return Value

Get_Font_Desc

function Get_Font_Desc
   (Self : not null access Gtk_Font_Button_Record)
    return Pango.Font.Pango_Font_Description
Parameters
Self
Return Value

Get_Font_Face

function Get_Font_Face
   (Self : not null access Gtk_Font_Button_Record)
    return Pango.Font_Face.Pango_Font_Face
Parameters
Self
Return Value

Get_Font_Family

function Get_Font_Family
   (Self : not null access Gtk_Font_Button_Record)
    return Pango.Font_Family.Pango_Font_Family
Parameters
Self
Return Value

Get_Font_Features

function Get_Font_Features
   (Self : not null access Gtk_Font_Button_Record) return UTF8_String
Parameters
Self
Return Value

Get_Font_Map

function Get_Font_Map
   (Self : not null access Gtk_Font_Button_Record)
    return Pango.Font_Map.Pango_Font_Map
Parameters
Self
Return Value

Get_Font_Name

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

Parameters
Font_Button
Return Value

an internal copy of the font name which must not be freed.

Get_Font_Size

function Get_Font_Size
   (Self : not null access Gtk_Font_Button_Record) return Glib.Gint
Parameters
Self
Return Value

Get_Language

function Get_Language
   (Self : not null access Gtk_Font_Button_Record) return UTF8_String
Parameters
Self
Return Value

Get_Level

function Get_Level
   (Self : not null access Gtk_Font_Button_Record)
    return Gtk.Font_Chooser.Gtk_Font_Chooser_Level
Parameters
Self
Return Value

Get_Preview_Text

function Get_Preview_Text
   (Self : not null access Gtk_Font_Button_Record) return UTF8_String
Parameters
Self
Return Value

Get_Related_Action

function Get_Related_Action
   (Self : not null access Gtk_Font_Button_Record)
    return Gtk.Action.Gtk_Action
Parameters
Self
Return Value

Get_Show_Preview_Entry

function Get_Show_Preview_Entry
   (Self : not null access Gtk_Font_Button_Record) return Boolean
Parameters
Self
Return Value

Get_Show_Size

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

Parameters
Font_Button
Return Value

whether the font size will be shown in the label.

Get_Show_Style

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

Parameters
Font_Button
Return Value

whether the font style will be shown in the label.

Get_Title

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

Parameters
Font_Button
Return Value

an internal copy of the title string which must not be freed.

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Use_Action_Appearance

function Get_Use_Action_Appearance
   (Self : not null access Gtk_Font_Button_Record) return Boolean
Parameters
Self
Return Value

Get_Use_Font

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

Parameters
Font_Button
Return Value

whether the selected font is used in the label.

Get_Use_Size

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

Parameters
Font_Button
Return Value

whether the selected size is used in the label.

Gtk_Font_Button

type Gtk_Font_Button is access all Gtk_Font_Button_Record'Class;

Gtk_Font_Button_New

function Gtk_Font_Button_New return Gtk_Font_Button

Creates a new font picker widget. Since: gtk+ 2.4

Return Value

Gtk_Font_Button_New_With_Font

function Gtk_Font_Button_New_With_Font
   (Fontname : UTF8_String) return Gtk_Font_Button

Creates a new font picker widget. Since: gtk+ 2.4

Parameters
Fontname

Name of font to display in font chooser dialog

Return Value

Gtk_Font_Button_Record

type Gtk_Font_Button_Record is new Gtk_Button_Record with null record;

Gtk_Font_Filter_Func

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.

Parameters
Family

a Pango.Font_Family.Pango_Font_Family

Face

a Pango.Font_Face.Pango_Font_Face belonging to Family

Return Value

True if the font should be displayed

Gtk_New

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.

Parameters
Font_Button

Gtk_New_With_Font

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.

Parameters
Font_Button
Fontname

Name of font to display in font chooser dialog

Implements_Gtk_Actionable

package Implements_Gtk_Actionable is new Glib.Types.Implements
  (Gtk.Actionable.Gtk_Actionable, Gtk_Font_Button_Record, Gtk_Font_Button);

Implements_Gtk_Activatable

package Implements_Gtk_Activatable is new Glib.Types.Implements
  (Gtk.Activatable.Gtk_Activatable, Gtk_Font_Button_Record, Gtk_Font_Button);

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Font_Button_Record, Gtk_Font_Button);

Implements_Gtk_Font_Chooser

package Implements_Gtk_Font_Chooser is new Glib.Types.Implements
  (Gtk.Font_Chooser.Gtk_Font_Chooser, Gtk_Font_Button_Record, Gtk_Font_Button);

Initialize

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.

Parameters
Font_Button

Initialize_With_Font

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.

Parameters
Font_Button
Fontname

Name of font to display in font chooser dialog

On_Font_Set

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.

Parameters
Self
Call
Slot
After

On_Font_Set

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.

Parameters
Self
Call
After

Set_Action_Name

procedure Set_Action_Name
   (Self        : not null access Gtk_Font_Button_Record;
    Action_Name : UTF8_String := "")
Parameters
Self
Action_Name

Set_Action_Target_Value

procedure Set_Action_Target_Value
   (Self         : not null access Gtk_Font_Button_Record;
    Target_Value : Glib.Variant.Gvariant)
Parameters
Self
Target_Value

Set_Detailed_Action_Name

procedure Set_Detailed_Action_Name
   (Self                 : not null access Gtk_Font_Button_Record;
    Detailed_Action_Name : UTF8_String)
Parameters
Self
Detailed_Action_Name

Set_Filter_Func

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

Parameters
Self
Filter

a Gtk_Font_Filter_Func, or null

Set_Font

procedure Set_Font
   (Self     : not null access Gtk_Font_Button_Record;
    Fontname : UTF8_String)
Parameters
Self
Fontname

Set_Font_Desc

procedure Set_Font_Desc
   (Self      : not null access Gtk_Font_Button_Record;
    Font_Desc : Pango.Font.Pango_Font_Description)
Parameters
Self
Font_Desc

Set_Font_Map

procedure Set_Font_Map
   (Self    : not null access Gtk_Font_Button_Record;
    Fontmap : access Pango.Font_Map.Pango_Font_Map_Record'Class)
Parameters
Self
Fontmap

Set_Font_Name

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

Parameters
Font_Button
Fontname

Name of font to display in font chooser dialog

Return Value

True

Set_Language

procedure Set_Language
   (Self     : not null access Gtk_Font_Button_Record;
    Language : UTF8_String)
Parameters
Self
Language

Set_Level

procedure Set_Level
   (Self  : not null access Gtk_Font_Button_Record;
    Level : Gtk.Font_Chooser.Gtk_Font_Chooser_Level)
Parameters
Self
Level

Set_Preview_Text

procedure Set_Preview_Text
   (Self : not null access Gtk_Font_Button_Record;
    Text : UTF8_String)
Parameters
Self
Text

Set_Related_Action

procedure Set_Related_Action
   (Self   : not null access Gtk_Font_Button_Record;
    Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Set_Show_Preview_Entry

procedure Set_Show_Preview_Entry
   (Self               : not null access Gtk_Font_Button_Record;
    Show_Preview_Entry : Boolean)
Parameters
Self
Show_Preview_Entry

Set_Show_Size

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

Parameters
Font_Button
Show_Size

True if font size should be displayed in dialog.

Set_Show_Style

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

Parameters
Font_Button
Show_Style

True if font style should be displayed in label.

Set_Title

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

Parameters
Font_Button
Title

a string containing the font chooser dialog title

Set_Use_Action_Appearance

procedure Set_Use_Action_Appearance
   (Self           : not null access Gtk_Font_Button_Record;
    Use_Appearance : Boolean)
Parameters
Self
Use_Appearance

Set_Use_Font

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

Parameters
Font_Button
Use_Font

If True, font name will be written using font chosen.

Set_Use_Size

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

Parameters
Font_Button
Use_Size

If True, font name will be written using the selected size.

Show_Size_Property

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

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

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.

Sync_Action_Properties

procedure Sync_Action_Properties
   (Self   : not null access Gtk_Font_Button_Record;
    Action : access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Title_Property

Title_Property : constant Glib.Properties.Property_String;

The title of the font chooser dialog.

Use_Font_Property

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

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.