INFO: Large Fonts Versus Small Fonts Use in Windows
If your application has User Interface designs based on screen coordinates,you might frequently find that switching to large or small font driverscauses the design to look bad. If you try to remedy the problem bycustomizing the design to the system font size in use, you fail because thesystem does not know, and cannot report to an application, what font sizethe user has selected when configuring the video driver.
Video drivers for the Windows operating systems have historically offeredthe capability to operate in large fonts or small fonts. These "modes"differ in that the fonts used in the system and in applications appearlarger on the display.
Video drivers accomplish this by reporting different values for theLOGPIXELSY and LOGPIXELSX flags of the GetDeviceCaps() function. They alsoinstall a new set of system raster fonts that directly support the newdisplay units. The operating system is not aware of this difference and isnot specifically aware of whether the user has selected large fonts orsmall fonts. Thus, it cannot report which mode the system is currently in.
Traditionally, video drivers report a value of 96 pixels per inch for smallfonts LOGPIXELSX and LOGPIXELSY values and 120 pixels per inch for largefonts LOGPIXELSX and LOGPIXELSY values. However, this is not reliablebecause there is no standard dictating these values. Furthermore, Windows95 allows the user to customize these return values to any arbitrary value.Other methods, such as the name of the video driver, have historically beenused to infer large fonts versus small fonts use as well, but none of thesemethods are reliable.
NOTE: The numbers and strings that appear in the Display Settings dialogbox of the operating system are either managed by the display driver ormerely data stored in the system registry. The presence of this data doesnot imply that the operating system can report it in a meaningful fashion.
Applications should not attempt to determine the system font size sincethere is no reliable way to obtain the information. Typically, developersrequest this information because they have used screen coordinates todesign the look of their application to a specific video display setting.
The solution is to avoid using a device dependent means of specifying theapplication's user interface layout. Instead, you should use Dialog Baseunits as described by the Knowledge Base articles listed in the "References"section of this article. These methods are portable from instance toinstance of the operating system irrespective of large fonts, small fonts,or screen size.
For more information on the best methods for dynamically creating dialogboxes and positioning controls please see the Knowledge Base articleslisted in the "References" section of this article.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
125681 How to calculate dialog base units with non-system-based
UI position float button control
Article ID: 177795 - Last Review: 06/22/2014 18:39:00 - Revision: 3.0
- kbdlg kbinfo kbwndw KB177795