1.77 <GtkFontDialog>

Class: <GtkFontDialog>

It derives from <GObject>.

Asynchronous API to present a font chooser dialog.

<GtkFontDialog> collects the arguments that are needed to present the dialog to the user, such as a title for the dialog and whether it should be modal.

The dialog is shown with the font-dialog:choose-font function or its variants.

See <GtkFontDialogButton> for a convenient control that uses <GtkFontDialog> and presents the results.

Properties

Property: font-dialog:filter self

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

Its value is a <GtkFilter>, or #f.

Set it with (set! (font-dialog:filter self) value).

Property: font-dialog:font-map self

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.

Its value is a <PangoFontMap>, or #f.

Set it with (set! (font-dialog:font-map self) value).

Property: font-dialog:language self

The language for which the font features are selected.

Its value is a <PangoLanguage>, or #f.

Set it with (set! (font-dialog:language self) value).

Property: font-dialog:modal self

Whether the font chooser dialog is modal.

Its value is a boolean.

Set it with (set! (font-dialog:modal self) value).

Property: font-dialog:title self

A title that may be shown on the font chooser dialog that is presented by font-dialog:choose-font.

Its value is a string, or #f.

Set it with (set! (font-dialog:title self) value).

Procedures

Method: font-dialog:choose-face self [parent] [initial-value] [cancellable] [callback]
Method: choose-face self [parent] [initial-value] [cancellable] [callback]

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.

self

Passed: a <GtkFontDialog>.

a font dialog

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

initial-value

Passed, or left out: a <PangoFontFace>, or #f.

the initial value

cancellable

Passed, or left out: a <GCancellable>, or #f.

a cancellable to cancel the operation

callback

Passed, or left out: a procedure, or #f.

a callback to call when the operation is complete

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: font-dialog:choose-face-finish self result ⇒ %return
Method: choose-face-finish self result ⇒ %return

Finishes the font-dialog:choose-face call.

Note that this function returns a Gtk.DialogError.DISMISSED error if the user cancels the dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

result

Passed: a <GAsyncResult>.

the result

%return

Returned: a <PangoFontFace>.

the selected <PangoFontFace>

Method: font-dialog:choose-family self [parent] [initial-value] [cancellable] [callback]
Method: choose-family self [parent] [initial-value] [cancellable] [callback]

Presents a font chooser dialog to the user.

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

self

Passed: a <GtkFontDialog>.

a font dialog

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

initial-value

Passed, or left out: a <PangoFontFamily>, or #f.

the initial value

cancellable

Passed, or left out: a <GCancellable>, or #f.

a cancellable to cancel the operation

callback

Passed, or left out: a procedure, or #f.

a callback to call when the operation is complete

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: font-dialog:choose-family-finish self result ⇒ %return
Method: choose-family-finish self result ⇒ %return

Finishes the font-dialog:choose-family call.

Note that this function returns a Gtk.DialogError.DISMISSED error if the user cancels the dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

result

Passed: a <GAsyncResult>.

the result

%return

Returned: a <PangoFontFamily>.

the selected <PangoFontFamily>

Method: font-dialog:choose-font self [parent] [initial-value] [cancellable] [callback]
Method: choose-font self [parent] [initial-value] [cancellable] [callback]

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 font-dialog:choose-font-and-features instead.

self

Passed: a <GtkFontDialog>.

a font dialog

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

initial-value

Passed, or left out: a <PangoFontDescription>, or #f.

the font to select initially

cancellable

Passed, or left out: a <GCancellable>, or #f.

a cancellable to cancel the operation

callback

Passed, or left out: a procedure, or #f.

a callback to call when the operation is complete

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: font-dialog:choose-font-and-features self [parent] [initial-value] [cancellable] [callback]
Method: choose-font-and-features self [parent] [initial-value] [cancellable] [callback]

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.

self

Passed: a <GtkFontDialog>.

a font dialog

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

initial-value

Passed, or left out: a <PangoFontDescription>, or #f.

the font to select initially

cancellable

Passed, or left out: a <GCancellable>, or #f.

a cancellable to cancel the operation

callback

Passed, or left out: a procedure, or #f.

a callback to call when the operation is complete

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: font-dialog:choose-font-and-features-finish self result ⇒ %return font-desc font-features language
Method: choose-font-and-features-finish self result ⇒ %return font-desc font-features language

Finishes the font-dialog:choose-font-and-features call.

The selected font and features are returned in font-desc and font-features.

Note that this function returns a Gtk.DialogError.DISMISSED error if the user cancels the dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

result

Passed: a <GAsyncResult>.

the result

%return

Returned: a boolean.

true if a font was selected

font-desc

Returned: a <PangoFontDescription>.

return location for font description

font-features

Returned: a string.

return location for font features

language

Returned: a <PangoLanguage>.

return location for the language

Method: font-dialog:choose-font-finish self result ⇒ %return
Method: choose-font-finish self result ⇒ %return

Finishes the font-dialog:choose-font call.

Note that this function returns a Gtk.DialogError.DISMISSED error if the user cancels the dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

result

Passed: a <GAsyncResult>.

the result

%return

Returned: a <PangoFontDescription>.

a <PangoFontDescription> describing the selected font

Method: font-dialog:get-filter self ⇒ %return
Method: get-filter self ⇒ %return

Returns the filter that decides which fonts to display in the font chooser dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

%return

Returned: a <GtkFilter>, or #f.

the filter

Method: font-dialog:get-font-map self ⇒ %return
Method: get-font-map self ⇒ %return

Returns the fontmap from which fonts are selected, or NULL for the default fontmap.

self

Passed: a <GtkFontDialog>.

a font dialog

%return

Returned: a <PangoFontMap>, or #f.

the fontmap

Method: font-dialog:get-language self ⇒ %return
Method: get-language self ⇒ %return

Returns the language for which font features are applied.

self

Passed: a <GtkFontDialog>.

a font dialog

%return

Returned: a <PangoLanguage>, or #f.

the language for font features

Method: font-dialog:get-modal? self ⇒ %return
Method: get-modal? self ⇒ %return

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

self

Passed: a <GtkFontDialog>.

a font dialog

%return

Returned: a boolean.

true if the font chooser dialog is modal

Method: font-dialog:get-title self ⇒ %return
Method: get-title self ⇒ %return

Returns the title that will be shown on the font chooser dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

%return

Returned: a string.

the title

Procedure: font-dialog:new ⇒ %return

Creates a new <GtkFontDialog> object.

%return

Returned: a <GtkFontDialog>.

the new <GtkFontDialog>

Method: font-dialog:set-filter self [filter]
Method: set-filter self [filter]

Adds a filter that decides which fonts to display in the font chooser dialog.

The filter must be able to handle both <PangoFontFamily> and <PangoFontFace> objects.

self

Passed: a <GtkFontDialog>.

a font dialog

filter

Passed, or left out: a <GtkFilter>, or #f.

the filter

Method: font-dialog:set-font-map self [fontmap]
Method: set-font-map self [fontmap]

Sets the fontmap from which fonts are selected.

If fontmap is NULL, the default fontmap is used.

self

Passed: a <GtkFontDialog>.

a font dialog

fontmap

Passed, or left out: a <PangoFontMap>, or #f.

the fontmap

Method: font-dialog:set-language self language
Method: set-language self language

Sets the language for which font features are applied.

self

Passed: a <GtkFontDialog>.

a font dialog

language

Passed: a <PangoLanguage>.

the language for font features

Method: font-dialog:set-modal self modal
Method: set-modal self modal

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

self

Passed: a <GtkFontDialog>.

a font dialog

modal

Passed: a boolean.

the new value

Method: font-dialog:set-title self title
Method: set-title self title

Sets the title that will be shown on the font chooser dialog.

self

Passed: a <GtkFontDialog>.

a font dialog

title

Passed: a string.

the new title