Package: pango

Function pango:context-load-font

Lambda List

pango:context-load-font (context desc)

Arguments

context -- a pango:context object
desc -- a pango:font-description instance describing the font to load

Return Value

The newly allocated pango:font object that was loaded, or nil if no font matched.

Details

Loads the font in one of the font maps in the Pango context that is the closest match for desc.

Example

Get the font for a Pango context.
(let* ((fontmap (pango:cairo-font-map-default))
       (context (pango:font-map-create-context fontmap))
       (desc (pango:font-description-from-string "Sans"))
       (font (pango:context-load-font context desc)))
  font)
=> #<PANGO:FONT {1002920D73}>    
 

See also

2024-2-23