Skip to main content
Logo Appt Light

Success Criterion 1.4.4 - Level AA

Resize text

Ensure that text can scale. Users set their preferred font size in the system settings. This is especially important for visually impaired users because they might not be able to read the text otherwise. In addition, scaled text may not be truncated, overlap other text or become unreachable.

Impact

  • 1 in 3 users has adjusted their font size, mostly to a larger font size.

  • If text does not resize, people with reduced vision will not be able to read text properly.

  • When elements do not support multiple lines of text, important text may be lost.

Check

Is text displayed larger when setting a larger font size preference?

This can be tested visually, set a larger font size in the system settings.

Solution

Support text scaling

On Android, you can use Scale-independent Pixels to scale text. This unit ensures that the user's preferences are taken into account when determining the font size. We recommend to define the textSize in your styles to make sure it's the same everywhere.

<style name="Widget.TextView">
    <item name="android:textSize">18sp</item>
</style>

Prevent text truncation

On Android, you can avoid text truncation by removing all instances of android:maxLines from your app. You should also avoid using fixed values for any heights or widths and instead use wrap_content where possible.

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Avoid text truncation" 
    android:maxLines="REMOVE" />

Resources

Feedback?

Let us know!