Inherit system settings for font, size, and color for all user interface controls.
On this page:
Rationale
Someone with a vision disability who has difficulty reading small text or text that does not have sufficient background contrast can use display settings available through the operating system to make information on the screen more accessible. These settings allow users to modify display settings to make software accessible without purchasing additional hardware and software.
On the Windows platform, users can customize font, size and color settings to meet their specific needs. Applications may also provide the capability to customize the font, size and color for use within an application. When an application provides customization an option must be provided that allows the user to choose their system settings for displayed information rather than the custom settings provided by the software.
Required development techniques
The following techniques are the minimum required to meet Checkpoint 4.5 from the IBM Software Accessibility Checklist:
- Software must support the user's settings for font, size and color. Software that provides custom application settings for font, size and color must provide the user an option to choose the systems settings for displayed information rather than using the custom application settings provided by the software.
- Scale the window size or provide the ability to scroll the window to ensure that as the font size is changed all of the information fits in the window or can be made visible and interactive through scrolling.
Note: The standard Microsoft Windows dialog box control does not support the user's font, size and color setting properly to comply with this checkpoint. This is a known deficiency in the platform. Software is not required to correct this deficiency to meet this checkpoint.
Examples for Microsoft Windows developers
1. Software must support the user's settings for font, size and color. Software that provides custom application settings for font, size and color must provide the user an option to choose the systems settings for displayed information rather than using the custom application settings provided by the software.
Example 1
Software can provide options for customizing the display of the program's content. However, there must be a configuration option in the software that tells the program not to use its own setting, but to use the setting the user has set in the display option of the control panel.
Use the font set for system messages. This font may be obtained by using the GetClientMetrics call.
Process the WM_THEMECHANGED control message to react to the user's system setting changes, and re-draw the software information based on the updated user choice.
Below is a code sample to obtain the logical font definition for the font being used by the system for messages. Because messages in Microsoft Windows do support the user's setting of the font size, this is a programmatic means to determine the correct font size to be used for text to be displayed.
Void GetClientMetrics(hDC, hWnd)
{
.
.
.
nonClientMetrics.cbSize =sizeof(NONCLIENTMETRICS);
// get system metrics information
fResult = SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&nonClientMetrics, // holds metric information
0);
/* Set the logical font to be based on the Message Font */
logFont=&nonClientMetrics.lfMessageFont;
/* Create the font */
hFont = CreateFontIndirect (logFont);
/* select the font for the application window DC */
SelectObject(hdc, hFont);
/* and so on */
}
2. Scale the window size or provide the ability to scroll the window to ensure that as the font size is changed all of the information fits in the window or can be made visible and interactive through scrolling.
Example 2
Use the SetWindowPos() to adjust the window size to accommodate the change in the font size.
Examples for Java developers
See the examples to implement system settings using Java Swing.
Examples for Eclipse SWT developers
1. Software must use the user's settings for font, size and color. Software that provides custom application settings for font, size and color must provide the user an option to choose the systems settings for displayed information rather than using the custom application settings provided by the software.
Example 3
Eclipse widgets (org.eclipse.swt.widgets) will automatically be created using the correct font and color based on the system settings for the class of user interface component they represent. Software must not set the font for any widgets created.
The font and color settings can be queried using org.eclipse.swt.display.Display.getSystemFont() and org.eclipse.swt.display.Display.getSystemColor(), respectively.
2. Scale the window size or provide the ability to scroll the window to ensure that as the font size is changed all of the information fits in the window or can be made visible and interactive through scrolling. This example is under development.
Recommended development techniques
The techniques above are required; the following techniques are recommended to enhance accessibility:
- Provide a magnification option in the View menu to allow flexible choice of enlarged text. Compare with Microsoft Word or Lotus 123. The size of text and graphics affects usability as well as accessibility. Many individuals who do not consider themselves to be disabled want to "view" a document or an application work area in an enlarged font while not affecting the actual document or work. For individuals with acknowledged visual impairments, the ability to magnify the application work area to 150%, 200% or greater may make the difference between being able to use the application or not. The vast majority of individuals who need this kind of access do not use screen magnifiers.
- Magnification features scale everything in the document to a user-selected ratio. Use of the TrueType scalable font technology ensures that characters will remain clearly defined at almost any size.
- If possible, allow the user to choose the draft font and size. Draft mode provides an option to display all text in a single font and size. Use underlining or a similar form of highlighting to indicate text that should be drawn with special formatting, such as bold or italics. (Draft mode also improves performance when running on slow systems or with little free memory.)
- Wrap to window options are helpful when displaying text documents. When the user chooses this option, the application should not break lines on the screen as they would appear on the printed page, but instead reflow each paragraph to fit the window.
Required test techniques
Test the software to ensure that it complies with accessibility requirements. To save time, step 1 can be combined with step 3, and step 2 can be combined with step 4.
Note: Some applications may not automatically recognize when the user has changed the system font, size and color settings. The software may need to be restarted or an application reopened in order for the changes to take effect. This is not a compliance failure.
Required test software
No additional software is required to test this checkpoint.
Test techniques
The following test techniques are required to verify this checkpoint:
| Actions | Results | |
|---|---|---|
| 1 | If the software automatically inherits font and size settings (Windows):
Note: For Windows 7 systems whose resolution starts with a default DPI of 150%, the custom DPI should be set to 225% and 300% to test Large and Extra Large fonts respectively. |
Pass: User interface controls are displayed in the new large font scheme. This includes menu items, title bars, icons, window borders and scroll bars. When displayed at the new font size, all text must still be visible in the window, or a method of scrolling the text must be available to allow the user to view all of the text. (For Microsoft Windows Vista, XP and earlier versions, text in standard Windows dialog boxes does not inherit the new font scheme since that is not supported by those versions of Windows. Windows 7 and later does support the inheritance of new font schemes in dialog boxes, so failure to meet the pass criterion on Windows 7 is an application accessibility defect.) Fail: Any failure to achieve the pass criteria listed above. If the software does not inherit any font size settings, check to see if the software provides an option to enable system font settings and perform the next test with the option enabled. |
| 2 | If the software provides an option to inherit system font settings instead of automatically inheriting them:
Note: For Windows 7 systems whose resolution starts with a default DPI of 150%, the custom DPI should be set to 225% and 300% to test Large and Extra Large fonts respectively. |
Pass: User interface controls are displayed in the new large font scheme. This includes menu items, title bars, icons, window borders and scroll bars. When displayed at the new font size, all text must still be visible in the window, or a method of scrolling the text must be available to allow the user to view all of the text. (For Microsoft Windows Vista, XP and earlier versions, text in standard Windows dialog boxes does not inherit the new font scheme since that is not supported by those versions of Windows. Windows 7 and later does support the inheritance of new font schemes in dialog boxes, so failure to meet the pass criterion on Windows 7 is an application accessibility defect.) Fail: Any failure to achieve the pass criteria listed above. The software provided an option to inherit system settings for font size, but did not inherit the new scheme for one or more items on the screen. |
| 3 | If the software automatically inherits system settings for color (Windows):
|
Pass: User interface controls are displayed in the new color scheme. This includes menu items, title bars, icons, window borders and scroll bars. Text in dialog boxes will not use the new font scheme since that is not supported by Windows. Fail: One or more user interface controls are not displayed in the new color scheme. If the software does not inherit any color settings, check to see if the software provides an option to enable system color settings and perform the next test with the option enabled. |
| 4 | If the software provides an option to inherit system settings for color (Windows):
|
Pass: User interface controls are displayed in the new color scheme. This includes menu items, title bars, icons, window borders and scroll bars. Text in dialog boxes will not use the new font scheme since that is not supported by Windows. Fail: The software did not automatically inherit system color settings and did not provide an option for users to choose the system settings. The software provided an option to inherit system settings for color, but did not inherit the new scheme for one or more items on the screen. |
©2012 IBM Corporation
Last updated August 30, 2012.
