All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

pane-scale-factor

screen-scale-factor Functions

Summary

Return the scale-factor of a screen or a pane.

Package

capi

Signatures

pane-scale-factor pane => scale-factor

screen-scale-factor &optional screen-spec => scale-factor

Arguments
pane
A pane.
screen-spec
A screen, or any argument accepted by convert-to-screen.
Values
scale-factor
A double-float or nil.
Description

The functions pane-scale-factor and screen-scale-factor return the scale factor of their argument. Except on Windows 10 and newer, this will currently always be 1d0.

On Windows 10 and newer, scale-factor specifies how much the display of the application is assumed by Windows to be scaled. So if the scale factor of a pane matches the scale factor of the monitor, its display is not scaled by Windows. Otherwise Windows scales the display itself. See set-dpi-awareness for more details.

screen-scale-factor converts screen-spec to a screen using convert-to-screen and then returns the scale factor of that screen. On Windows 10 and newer, this corresponds to the scale factor of the application when it started the GUI.

pane-scale-factor returns the scale factor of pane, which is currently always the same as the scale factor of the top level interface containing pane. This value may be different from the scale factor that screen-scale-factor returns when the DPI awareness is set :monitor (by set-dpi-awareness). If the top level interface of pane is not displayed, pane-scale-factor returns nil.

Notes

If screen-scale-factor is called before the GUI started, it initializes the GUI, because that is what convert-to-screen does.

LispWorks itself scales its fonts by the scale factor of the screen, rather than the pane it draws into. That may be an issue only when the DPI awareness is :monitor. Other objects, most importantly images and graphics drawing, are not automatically scaled by LispWorks.

See also

set-dpi-awareness


CAPI User Guide and Reference Manual (Unix version) - 18 Feb 2025 15:34:22