FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

ask-user-for-font

Arguments: &key stream-for-font initial-font fixed-width-only-p minimum-size maximum-size initial-point-size stream

Pops up the Windows Common Dialog for font selection. This function is also used internally by Allegro CL for font selection. If a font is selected, two values are returned: the font selected and the point size specified by the user. (See below for why the point size might be useful.) If s/he cancels, the single value nil is returned.

The arguments are as follows:

When selecting a font, one potential source of confusion is that while Allegro CL specifies font sizes in pixels, the Common Dialog specifies them in points. So the size that you select from the dialog will not be the same as the size value in the returned font object. But the point size specified will be returned as the second returned value -- see the next paragraph. Allegro CL uses pixel-size programmatically so that the same units are used for all sizes associated with a window --fonts, window dimensions, drawing, etc. The point sizes that appear in the Common Dialog, on the other hand, will be similar to those that are familiar from choosing fonts interactively in other applications.

The point size is provided as the second returned value to permit better communication with users. Suppose a user of your application is presented with the dialog displayed by this function and asked to choose a font for use in some table of data that the application will display. Suppose further that the program determines that the font chosen is so large that it will cause line truncation or wrapping. A dialog might be displayed telling the user that the chosen font will cause problems and that s/he might wish to choose a smaller font. Mentioning the point size in that dialog will be more meaningful to users (because it corresponds to the value they actually chose) than mentioning the pixel size, which is a value they likely will not have seen. Note that both the point size and the pixel size are contained in the Windows font structure, from which Allegro CL gets all font information. Allegro CL does not itself derive a pixel size from the point size.

GTK Note

The native GTK font dialog will ignore the following arguments: stream-for-font, fixed-width-only-p, minimum-size, maximum-size, and initial-point-size.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version