FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

exact-font

Arguments: font &key stream

Returns the actual font that is being used for some requested font.

The returned font will be equivalent to the requested font if the requested font is an available font, and otherwise will be the approximation to it that the Operating System has decided to use in its place. For example,

(exact-font (make-font-ex nil :|ms sans serif| 8)) 

may return

#.(make-font-ex :swiss :|ms sans serif| 13) 

since there are only a couple of sizes for that font face available, and the "family" is always filled in.

For the special system fonts returned by the functions system-font, system-fixed-font, ansi-var-font, and ansi-fixed-font, exact-font can be used to find the face and size that each of these special fonts is mapped to by the Operating System. For example,

(exact-font (system-fixed-font)) 

may return

#.(make-font-ex :modern :fixedsys 18).

NOTE: If neither font nor any other font object that has the same properties (family, face, size, and bold/italic) as font has been assigned to any window yet, then exact-font will return nil because the Operating System has not yet been asked to create a real Operating System font for this font object. So exact-font is normally called on a font that has been assigned to a window with (setf font) or the :font initarg of make-window. If you would like to call exact-font before creating the window that will use the font, as a work-around you could use (setf font) to set the font of (screen *system*) (see screen and *system*) to the font before calling exact-font on the font.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version