Readable and adjustable fonts
Sighted visitors should be able to see, read, and understand the content on a webpage or view with ease. Additionally, they should be able to adjust the text appearance without the use of assistive technology.
For accessibility, it’s important that a user should be able to:
- resize only the text up to 200%, or
- zoom in the whole view up to 400%, or
- change the text style properties like line height and spacing.
And do so without losing content or functionality. This means that after resizing, zooming, or changing the text style properties, no text or focusable elements overlap or become unreachable by mouse or keyboard. This is further explained in the text below.
For readability, it’s important to provide fonts in sizes and shapes that are easy to read. WCAG 2 doesn’t provide guidelines for font size or shape, but it’s best practice to offer fonts that are easy to read.
Note: Text should also have a good color contrast to be readable. The topic Color contrast of text against its background addresses this.
Resize text and reflow
The difference between resize and reflow: resize affects only the text itself; reflow zooms the entire view of a web page.
Both can be executed by pressing Ctrl + (Windows) or Cmd + (Mac). How you zoom depends on the browser settings. How to test for resize and zoom in detail is described in Support for reflow, resize, and text spacing changes in the Theme guidelines for the WordPress accessibility-ready program.
Resize text
The WCAG guideline 1.4.4 for resizing text is summarized as follows: users must be able to double the font size without loss of content or functionality.
Exceptions are captions and images of text, although it’s still a fail if the text in the image gets cut off.
The quickest way to test this is to use the Firefox browser and, in the toolbar, select View > Zoom > Check Text only. Then use Ctrl + (Windows) or Cmd + (Mac) to zoom in up to 200%.
Reflow
The WCAG guideline 1.4.10 for reflow is summarized as follows: users must be able to zoom in up to 400% to enlarge the whole view without loss of content or functionality and without requiring scrolling in two dimensions.
This is the most common way to enlarge text. Use Ctrl + (Windows) or Cmd + (Mac) to zoom in up to 400% to enlarge the whole view. Note: 400% is a lot.
Mostly, responsive websites handle this well, but check that no functionality is lost, hidden, or overlapped by other elements. Don’t assume these views only appear on mobile; users who are visually impaired may zoom in on a large screen.
Multidimensional scrolling
Enlarging the font size or view can result in a horizontal scroll bar. Then the user has 2 scrollbars to handle, which can be hard to navigate or understand. Avoid multidimensional scrolling.
But there are exceptions. according to Understanding SC 1.4.10 Reflow by the W3C:
Examples of content which requires two-dimensional layout are images required for understanding (such as maps and diagrams), video, games, presentations, data tables (not individual cells), and interfaces where it is necessary to keep toolbars in view while manipulating content. It is acceptable to provide two-dimensional scrolling for such parts of the content.
Viewport
Always give the user the opportunity to scale the display themselves. So, never set the viewport to user-scalable=no;. This setting prevents the user from using the browser’s zoom on mobile devices. Many mobile devices will ignore this meta setting due to its impact on accessibility.
Don’t: Prevent users to alter the text size in a webpage.
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
Do: Give users control of how they view text a webpage.
<meta name="viewport" content="width=device-width, initial-scale=1">
Adjustable text style properties
Users may have their own settings and preferences for how text appears. These settings must be supported. No content or functionality may be lost. Some people need text with a different appearance. This includes people with visual impairments and people with dyslexia.
The following settings must be supported:
- Line height of at least 1.5 times the font size;
- Spacing between paragraphs of at least 2 times the font size;
- Letter spacing of at least 0.12 times the font size;
- Word spacing of at least 0.16 times the font size.
In practice, when a user adds custom CSS, the content should adapt to it and remain readable. For example:
{
line-height: 1.5 !important;
letter-spacing: 0.12em !important;
word-spacing: 0.16em !important;
}
p {
margin-bottom: 2em !important;
}
The common way to test this is to view the webpage using the text spacing bookmarklet by Steven Faulkner.
Please note: The website doesn’t need to offer settings to customize this in a toolbar. The settings only need to be supported in HTML/CSS when the user sets them.
How to test text spacing in detail is described in Support for reflow, resize, and text spacing changes in the Theme guidelines for the WordPress accessibility-ready program.
Font size and shape
WCAG 2 doesn’t provide guidelines for font size or shape, but it’s best practice to offer font that is easy to read.
One takeaway for choosing a good font: make sure there is a visual difference between:
- 0 (zero) and O (capital o),
- 1 (one), l, L (capital l) and I (capital i).
The topic Readability in the Content and images section addresses best practices for Text style and layout. For example:
- Use uppercase carefully. Uppercase obscures the shape of the word and can make it harder to understand. Screen readers will announce some short words as abbreviations.
- Use italic and bold text carefully, as it interrupts the reading flow. If the information is important, think about making it stand alone.
- Use enough line-height and a large enough font-size. A font size of at least 16 pixels works well for body copy.
Relative units vs. absolute units
Whether a font size is defined in pixels, em, rem, or % units for resizing doesn’t really matter. Modern browsers adequately resize text regardless of how its size is defined.
There is much research and debate about whether text elements should be defined in pixels, em, rem, or % units for resizing, and whether only the text or also other elements on a page should scale.
Operating systems, browsers, and devices have various ways to enlarge text:
- with the OS settings,
- with assistive technology, like Zoom Text,
- browser settings to enlarge text,
- a plugin that changes the default text size,
- zoom in and out with the keys Control plus and minus in the browser,
- using your fingers on touch devices,
- reader view in browsers.
The WordPress Accessibility Team agrees with WebAim on font size:
Relative font sizes (such as percents or ems) provide more flexibility in modifying the visual presentation compared to absolute units (such as pixels or points).
Resources
WCAG Success Criteria for text presentation
- Success Criterion 1.4.4, Resize Text (Level AA).
- Success Criterion 1.4.10, Reflow (Level AA).
- Success Criterion 1.4.12, Text Spacing (Level AA).
Related pages in this documentation
- Support for reflow, resize, and text spacing changes in the Theme guidelines for the WordPress accessibility-ready program.
- Readability in Standards and best practice, Content and images.
Other resources
- Typefaces and Fonts by WebAIM.
- Ultimate Guide: EM vs REM vs PX Which Is Better & Why? by Seb Kay for Fhoke.
- Visual principles by Google.
- Accessible Fonts: How to Choose the Best Ones by Jennifer Gaskin for Venngage.
WP Accessibility Knowledge Base