amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-fit-text: Content is unreadable when text style is adjusted

Open TetraLogicalHelpdesk opened this issue 6 years ago • 3 comments

WCAG Level

Level AA

Priority

High

Type

Adaptability

Pages/Components affected

Description

An important design consideration is to make sure that the display of text can be adjusted, so that line height, spacing between paragraphs, and spacing between words and letters can be changed without the content becoming unreadable.

Currently, if a user adjusts their letter/word/line spacing, all variations of <amp-fit-text> - depending on the specific size defined for the component and the amount of content inside them - can end up cropping / clipping content.

Below are screenshots from the examples page, after the spacing metrics have been forcibly changed via this text spacing bookmarklet. Note that in all instances, the content of some of the boxes is clipped (either at the start, or end, or both, of the example sentence).

Basic usage

Basic example with cropped content after spacing adjustment

Aspect ratio

Aspect ratio example with cropped content after spacing adjustment

min-font-size

min-font-size example with cropped content after spacing adjustment

max-font-size

max-font-size example with cropped content after spacing adjustment

User impact

Someone with a cognitive or reading disability like Dyslexia may find content easier to read when there is more space between letters, words, lines and paragraphs. If content becomes hidden or obscured when they adjust the way text is displayed it makes the problem worse not better.

In this case, depending on the size of the <amp-fit-text> element and the amount of content, users may end up being unable to read/perceive the information contained in the element.

Required solution

Make sure that the element takes spacing metrics into account when doing its fit calculations. As users may change these spacing metrics after the page has loaded/the elements have rendered, this may require listening for changes and redoing the calculation/fit dynamically.

Test procedure(s)

Use these steps to confirm that the solution has been correctly applied:

  1. Install a tool like the ARC Toolkit, which contains an option to change text spacing, or the text spacing bookmarklet.
  2. Check that the text on the page responds to the changes.
  3. Check that all content and functionality remains readable and available after the display of text has changed.

Related standards

More information

Test data

Test date: July 2020

TetraLogicalHelpdesk avatar Jul 29 '20 10:07 TetraLogicalHelpdesk

Claiming this issue for the fixit. :)

rbeckthomas avatar Oct 22 '20 18:10 rbeckthomas

Any update on this?

zhouyx avatar Oct 27 '20 23:10 zhouyx

AMP Components don't usually react properly to events caused by external JS. A ResizeObserver would be a natural way to solve this, but we don't polyfill that yet (its on the todo list).

I'm not sure of another way to solve this until ResOb is polyfilled :/

samouri avatar Nov 17 '20 01:11 samouri