Package: gtk

Function gtk:font-chooser-set-filter-func

Lambda List

gtk:font-chooser-set-filter-func (fontchooser func)

Arguments

fontchooser -- a gtk:font-chooser widget
filter -- a gtk:font-filter-func callback function, or nil

Details

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

Examples

A callback filter function to select fonts from the font families "Sans" and "Serif":
;; Define the callback function
(defun font-filter (family face)
  (declare (ignore face))
  (member (pango:font-family-name family)
          '("Sans" "Serif")
          :test #'equal))
;; Set the function FONT-FILTER as the callback function
(gtk:font-chooser-set-filter-func button #'font-filter)
;; Remove the filter function from the font button
(gtk:font-chooser-set-filter-func button nil)    
 

See also

#2023-3-5