image-of-text

Text should be real text, not an image of text

manualWCAG 1.4.5 (AA)confidence: lowseverity: moderateperceivable

Asks about images that markup shows are likely to hold text (an <input type="image">, or an <img> showing an SVG with <text>), whether that text could be real text.

Applies to. Applies to two kinds of image that markup shows are likely to hold text, when they are rendered:

  • an <input type="image">, a button drawn as an image, which nearly always carries its label as text in the image;
  • an <img> whose source is an SVG data URL whose markup holds a <text> element: the text is drawn as part of the image, which can't be restyled as text can.

Other images are not asked about: whether an image holds text is in its pixels, which a scan of the markup doesn't see. An inline <svg> with <text> is real text, and is out of scope (ACT 0va7u6). Finding nothing to ask about, it reports notApplicable, not pass: it applies only to what its check flags, and finding nothing there doesn't show that all is well.

Expectation. Text that can be real text is real text, styled with CSS, rather than an image of text, unless the image can be customized to the user's needs or the particular presentation of the text is essential, as in a logo (WCAG 1.4.5).

Examples

can't tell
<input type="image" src="send-button.png" alt="Send">

A button drawn as an image nearly always carries its label as text in the image; a <button> with real text could do the same.

can't tell
<img alt="WCAG Rocks" src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><text x='0' y='15'>WCAG Rocks</text></svg>">

The SVG's <text> is drawn as part of the image, where it can't be restyled as text.

n/a
<svg xmlns="http://www.w3.org/2000/svg"><text x="0" y="15">WCAG Rocks</text></svg>

An inline SVG's text is real text.

How to check

When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.

IMAGE_BUTTON_TEXT_REVIEW

  1. Find the image button the report names and look at the image.
  2. Check whether the image contains words or letters, not only an icon.
  3. If it does, decide whether that text could be real text styled with CSS, or whether its look is essential (a logo).

Pass. The image holds no text, only an icon or picture, or the text is a logo or otherwise essential.

Fail. The button shows its label as text in an image that could be real text, which fails WCAG 1.4.5.

SVG_IMAGE_TEXT_REVIEW

  1. Find the image the report names and look at the text drawn in it.
  2. Decide whether it is a logo or wordmark, or text such as a heading, sentence or label.
  3. If it is not a logo, decide whether the text could be real text styled with CSS, or whether its look is essential.

Pass. The text is a logo or its look is essential (or it is only incidental, such as a chart's axis numbers).

Fail. The image draws text that could be real text and is not a logo, which fails WCAG 1.4.5.

View source