Small Font Size

Id SmallFontSize
Summary Text is smaller than accessibility recommendations, hindering readability
Severity Warning
Category Visual Accessibility
Affects Resource files and Kotlin and Java files
Implementation Custom lint rule – flags text elements with font size below recommended minimum (e.g., 14sp for body text)

Symptom

Text elements use font sizes that are too small for comfortable reading.

Rationale

Creates significant reading barriers for users with visual impairments, low vision, or age-related vision changes, forcing them to rely on device zoom which can disrupt layout and navigation, potentially making content completely inaccessible to some users.

Examples

Resource File:

<!-- Font sizes below recommended minimums -->
<dimen name="caption_text_size">10sp</dimen>      <!-- Too small for body text -->
<dimen name="small_label_size">8sp</dimen>        <!-- Too small for any text -->
<dimen name="micro_text_size">6sp</dimen>         <!-- Illegible on most devices -->

XML Layout Example

<!-- Text size too small for comfortable reading -->
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Important disclaimer text"
    android:textSize="10sp" />

Kotlin Code Example

class TextHelper {

    fun setSmallTextSize(textView: TextView) {
        textView.textSize = 8f // Too small in sp
    }
}

GitHub issues under this tag