Class: Gtk::FontDialog

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Gtk::FontDialog

Creates a new GtkFontDialog object.

Instance Method Details

#choose_face(parent, initial_value, cancellable, callback, user_data) ⇒ nil

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.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • initial_value (Pango::FontFace) —

    the initial value

  • cancellable (Gio::Cancellable) —

    a cancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback) —

    a callback to call when the
    operation is complete

  • user_data (GObject) —

    data to pass to callback

Returns:

  • (nil)

#choose_face_finish(result) ⇒ Pango::FontFace

Finishes the [methodGtk.FontDialog.choose_face] call.

Note that this function returns a [errorGtk.DialogError.DISMISSED]
error if the user cancels the dialog.

Parameters:

  • result (Gio::AsyncResult) —

    the result

Returns:

  • (Pango::FontFace) —

    the selected [classPango.FontFace]

#choose_family(parent, initial_value, cancellable, callback, user_data) ⇒ nil

Presents a font chooser dialog to the user.

The font chooser dialog will be set up for selecting a font family.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • initial_value (Pango::FontFamily) —

    the initial value

  • cancellable (Gio::Cancellable) —

    a cancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback) —

    a callback to call when the
    operation is complete

  • user_data (GObject) —

    data to pass to callback

Returns:

  • (nil)

#choose_family_finish(result) ⇒ Pango::FontFamily

Finishes the [methodGtk.FontDialog.choose_family] call.

Note that this function returns a [errorGtk.DialogError.DISMISSED]
error if the user cancels the dialog.

Parameters:

  • result (Gio::AsyncResult) —

    the result

Returns:

  • (Pango::FontFamily) —

    the selected [classPango.FontFamily]

#choose_font(parent, initial_value, cancellable, callback, user_data) ⇒ nil

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.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • initial_value (Pango::FontDescription) —

    the font to select initially

  • cancellable (Gio::Cancellable) —

    a cancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback) —

    a callback to call when the
    operation is complete

  • user_data (GObject) —

    data to pass to callback

Returns:

  • (nil)

#choose_font_and_features(parent, initial_value, cancellable, callback, user_data) ⇒ nil

Presents a font chooser dialog to the user.

The font chooser dialog will be set up for selecting a font
and specify features for the selected font.

Font features affect how the font is rendered, for example
enabling glyph variants or ligatures.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • initial_value (Pango::FontDescription) —

    the font to select initially

  • cancellable (Gio::Cancellable) —

    a cancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback) —

    a callback to call when the
    operation is complete

  • user_data (GObject) —

    data to pass to callback

Returns:

  • (nil)

#choose_font_and_features_finish(result, font_desc, font_features, language) ⇒ Boolean

Finishes the [methodGtk.FontDialog.choose_font_and_features] call.

The selected font and features are returned in font_desc and
font_features.

Note that this function returns a [errorGtk.DialogError.DISMISSED]
error if the user cancels the dialog.

Parameters:

  • result (Gio::AsyncResult) —

    the result

  • font_desc (Pango::FontDescription) —

    return location for font description

  • font_features (String) —

    return location for font features

  • language (Pango::Language) —

    return location for the language

Returns:

  • (Boolean) —

    true if a font was selected

#choose_font_finish(result) ⇒ Pango::FontDescription

Finishes the [methodGtk.FontDialog.choose_font] call.

Note that this function returns a [errorGtk.DialogError.DISMISSED]
error if the user cancels the dialog.

Parameters:

  • result (Gio::AsyncResult) —

    the result

Returns:

  • (Pango::FontDescription) —

    a [structPango.FontDescription] describing
    the selected font

#filter ⇒ Gtk::Filter

A filter to restrict what fonts are shown in the font chooser dialog.

Returns:

#filter=(filter) ⇒ Gtk::Filter

A filter to restrict what fonts are shown in the font chooser dialog.

Parameters:

Returns:

#font_map ⇒ Pango::FontMap

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.

Returns:

  • (Pango::FontMap) —

    font-map

#font_map=(font_map) ⇒ Pango::FontMap

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.

Parameters:

  • font_map (Pango::FontMap)

Returns:

  • (Pango::FontMap) —

    font-map

  • (Pango::FontMap) —

    font-map

#language ⇒ Pango::Language

The language for which the font features are selected.

Returns:

  • (Pango::Language) —

    language

#language=(language) ⇒ Pango::Language

The language for which the font features are selected.

Parameters:

  • language (Pango::Language)

Returns:

  • (Pango::Language) —

    language

  • (Pango::Language) —

    language

Returns whether the font chooser dialog blocks interaction
with the parent window while it is presented.

Returns:

  • (Boolean) —

    true if the font chooser dialog is modal

#modal=(modal) ⇒ Boolean

Whether the font chooser dialog is modal.

Parameters:

  • modal (Boolean)

Returns:

  • (Boolean) —

    modal

  • (Boolean) —

    modal

#modal? ⇒ Boolean

Whether the font chooser dialog is modal.

Returns:

  • (Boolean) —

    modal

#title ⇒ String

A title that may be shown on the font chooser
dialog that is presented by [methodGtk.FontDialog.choose_font].

Returns:

  • (String) —

    title

#title=(title) ⇒ String

A title that may be shown on the font chooser
dialog that is presented by [methodGtk.FontDialog.choose_font].

Parameters:

  • title (String)

Returns:

  • (String) —

    title

  • (String) —

    title