Package: gtk

Function gtk-font-chooser-font-map

Lambda List

gtk-font-chooser-font-map (fontchooser)

Syntax

(gtk-font-chooser-font-map fontchooser) => fontmap
(setf (gtk-font-chooser-font-map fontchooser) fontmap)

Arguments

fontchooser -- a gtk-font-chooser widget
fontmap -- a pango-font-map object, or nil

Details

Accessor of the Pango font map of the font chooser widget.

The function gtk-font-chooser-font-map gets the custom font map of the font chooser widget, or nil if it does not have one. The function (setf gtk-font-chooser-font-map) sets a custom font map to use for the font chooser widget. A custom font map can be used to present application specific fonts instead of or in addition to the normal system fonts.

Since 3.18

Example

The example from the C documentation uses the Fontconfig library for configuring and customizing font access. This library is not available for the Lisp binding.
FcConfig *config;
PangoFontMap *fontmap;

config = FcInitLoadConfigAndFonts (); FcConfigAppFontAddFile (config, my_app_font_file);

fontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT); pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);

gtk_font_chooser_set_font_map (font_chooser, fontmap);
Note that other GTK+ widgets will only be able to use the application specific font if it is present in the font map they use. The following code updates the font map for a gtk-label widget with fontmap.
(setf (pango-context-font-map (gtk-widget-pango-context label)) fontmap)    
 

See also

2021-1-20