Class: Gtk::FontDialog

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

Instance Method Summary collapse

Constructor Details

#initializeGtk::FontDialog

Creates a new GtkFontDialog object.

Instance Method Details

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

This function initiates a font selection operation by
presenting a dialog to the user for selecting a font face
(i.e. a font family and style, but not a specific font size).

The callback will be called when the dialog is dismissed.
It should call [methodGtk.FontDialog.choose_face_finish]
to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • initial_value (Pango::FontFace)

    the initial value

  • cancellable (Gio::Cancellable)

    a GCancellable 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
and returns the resulting font face.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Pango::FontFace)

    the selected font face

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

This function initiates a font selection operation by
presenting a dialog to the user for selecting a font family.

The callback will be called when the dialog is dismissed.
It should call [methodGtk.FontDialog.choose_family_finish]
to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • initial_value (Pango::FontFamily)

    the initial value

  • cancellable (Gio::Cancellable)

    a GCancellable 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
and returns the resulting family.

This function never returns an error. If the operation is
not finished successfully, the value passed as initial_value
to [methodGtk.FontDialog.choose_family] is returned.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Pango::FontFamily)

    the selected family

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

This function initiates a font selection operation by
presenting a dialog to the user for selecting a font.

The callback will be called when the dialog is dismissed.
It should call [methodGtk.FontDialog.choose_font_finish]
to obtain the result.

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 GtkWindow

  • initial_value (Pango::FontDescription)

    the font to select initially

  • cancellable (Gio::Cancellable)

    a GCancellable 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

This function initiates a font selection operation by
presenting a dialog to the user for selecting a font and
font features.

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

The callback will be called when the dialog is dismissed.
It should call [methodGtk.FontDialog.choose_font_and_features_finish]
to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • initial_value (Pango::FontDescription)

    the font to select initially

  • cancellable (Gio::Cancellable)

    a GCancellable 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 and returns the resulting font description and font features.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

  • 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. Otherwise FALSE is returned
    and error is set

#choose_font_finish(result) ⇒ Pango::FontDescription

Finishes the [methodGtk.FontDialog.choose_font] call
and returns the resulting font description.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Pango::FontDescription)

    the selected font

#filterGtk::Filter

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

Returns:

#filter=(filter) ⇒ Gtk::Filter

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

Parameters:

Returns:

#font_mapPango::FontMap

Sets 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

Sets 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

#languagePango::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

#titleString

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