Skip to content

Document Android 14+ non-linear font scaling on getFontScale and allowFontScaling - #5205

Open
sbaiahmed1 wants to merge 1 commit into
react:mainfrom
sbaiahmed1:docs/android-nonlinear-font-scaling
Open

Document Android 14+ non-linear font scaling on getFontScale and allowFontScaling#5205
sbaiahmed1 wants to merge 1 commit into
react:mainfrom
sbaiahmed1:docs/android-nonlinear-font-scaling

Conversation

@sbaiahmed1

Copy link
Copy Markdown

The PixelRatio.getFontScale() docs currently tell readers the value "is used to calculate the absolute font size", and the allowFontScaling docs imply a single scale factor. On Android 14 and newer that is no longer accurate: the OS applies non-linear font scaling once the user's font scale is ≥ 1.05 — small fonts grow by roughly the full factor while large fonts grow progressively less, and a 30sp font does not grow at all until the setting exceeds 1.5 (per AOSP's FontScaleConverterFactory tables). React Native inherits this via TypedValue.applyDimension(COMPLEX_UNIT_SP, …), so fontSize * getFontScale() overestimates rendered sizes of large text.

This mismatch was mistaken for a rendering bug in react/react-native#56961 — I verified there that RN matches the platform tables exactly (measurements in this comment).

Changes:

  • docs/pixelratio.md: add a note under getFontScale() explaining non-linear scaling and the caveat about multiplying by the returned value.
  • docs/text.md: add one sentence under allowFontScaling.
  • Same two changes in website/versioned_docs/version-0.86/.

…wFontScaling

On Android 14 and newer, the OS scales fonts non-linearly (small sizes
grow by the full factor, large sizes progressively less; 30sp is pinned
until the setting exceeds 1.5), so PixelRatio.getFontScale() no longer
predicts rendered text sizes. Document this on the PixelRatio and Text
pages for next and 0.86.

Prompted by react/react-native#56961, where the non-linear curve was
mistaken for a rendering bug.
@meta-cla meta-cla Bot added the CLA Signed label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant