Portable font descriptions are designed to solve the following problems:
All the functions described below are exported from the
You can obtain the names of all the fonts which are available for a given pane by calling list-all-font-names, which returns a list of partially-specified font descriptions.
Portable font descriptions are used only for lookup of real fonts and for storing the parameters to specify when doing a font lookup operation. To draw text in a specified font using the Graphics Ports drawing functions, supply in the graphics state a font object as returned by find-matching-fonts and find-best-font.
Font attributes are properties of a font, which can be combined to uniquely specify a font on a given platform. There are some portable attributes which can be used on all platforms; other attributes are platform-specific and will be ignored or signal errors when used on the wrong platform.
Font descriptions are externalizable objects which contain a set of font attributes. When using a font description in a font lookup operation, missing attributes are treated as wildcards (as are those with value
:wild) and invalid attributes signal errors. The result of a font lookup contains all the attributes needed to uniquely specify a font on that platform.
Once a font object is resolved you can read its properties such as height, width and average width. The functions get-font-height, get-font-width and get-font-average-width and so on need a pane that has been created. In general, you need to call these functions within interface-display, or a display-callback or possibly a create-callback . See the manual page for interface for more information about these initargs.
You can define font aliases, which map a keyword symbol to some font or font description, using define-font-alias. You can then use this the keyword as the font for CAPI panes.
CAPI User Guide and Reference Manual (Unix version) - 25 Feb 2015