From 68fbb6cf3b8285eab1b99a1a6f6324677c3213ed Mon Sep 17 00:00:00 2001 From: Ahmed Sbai Date: Fri, 28 Aug 2026 02:42:38 +0200 Subject: [PATCH] Document Android 14+ non-linear font scaling on getFontScale and allowFontScaling 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 facebook/react-native#56961, where the non-linear curve was mistaken for a rendering bug. --- docs/pixelratio.md | 4 ++++ docs/text.md | 2 ++ website/versioned_docs/version-0.86/pixelratio.md | 4 ++++ website/versioned_docs/version-0.86/text.md | 2 ++ 4 files changed, 12 insertions(+) diff --git a/docs/pixelratio.md b/docs/pixelratio.md index f298a8e73ab..61d560dd38b 100644 --- a/docs/pixelratio.md +++ b/docs/pixelratio.md @@ -149,6 +149,10 @@ Returns the scaling factor for font sizes. This is the ratio that is used to cal If a font scale is not set, this returns the device pixel ratio. +:::note +On Android 14 and newer, the system scales fonts [non-linearly](https://developer.android.com/about/versions/14/features#non-linear-font-scaling) once the user's font scale is 1.05 or higher: small fonts grow by roughly the full factor, while larger fonts grow progressively less (for example, a 30sp font does not grow at all until the setting exceeds 1.5). `getFontScale()` still returns the linear preference value (such as `1.3`), so multiplying a font size by it will overestimate the rendered size of large text on these devices. +::: + --- ### `getPixelSizeForLayoutSize()` diff --git a/docs/text.md b/docs/text.md index b637552bfa5..33b4ee15b56 100644 --- a/docs/text.md +++ b/docs/text.md @@ -312,6 +312,8 @@ Specifies whether fonts should be scaled down automatically to fit given style c Specifies whether fonts should scale to respect Text Size accessibility settings. +On Android 14 and newer, scaling is [non-linear](https://developer.android.com/about/versions/14/features#non-linear-font-scaling): as the user's font scale setting grows, large fonts are scaled up less than small ones. + | Type | Default | | ------- | ------- | | boolean | `true` | diff --git a/website/versioned_docs/version-0.86/pixelratio.md b/website/versioned_docs/version-0.86/pixelratio.md index f298a8e73ab..61d560dd38b 100644 --- a/website/versioned_docs/version-0.86/pixelratio.md +++ b/website/versioned_docs/version-0.86/pixelratio.md @@ -149,6 +149,10 @@ Returns the scaling factor for font sizes. This is the ratio that is used to cal If a font scale is not set, this returns the device pixel ratio. +:::note +On Android 14 and newer, the system scales fonts [non-linearly](https://developer.android.com/about/versions/14/features#non-linear-font-scaling) once the user's font scale is 1.05 or higher: small fonts grow by roughly the full factor, while larger fonts grow progressively less (for example, a 30sp font does not grow at all until the setting exceeds 1.5). `getFontScale()` still returns the linear preference value (such as `1.3`), so multiplying a font size by it will overestimate the rendered size of large text on these devices. +::: + --- ### `getPixelSizeForLayoutSize()` diff --git a/website/versioned_docs/version-0.86/text.md b/website/versioned_docs/version-0.86/text.md index 0e72ec8c27b..cf2fe73fb95 100644 --- a/website/versioned_docs/version-0.86/text.md +++ b/website/versioned_docs/version-0.86/text.md @@ -312,6 +312,8 @@ Specifies whether fonts should be scaled down automatically to fit given style c Specifies whether fonts should scale to respect Text Size accessibility settings. +On Android 14 and newer, scaling is [non-linear](https://developer.android.com/about/versions/14/features#non-linear-font-scaling): as the user's font scale setting grows, large fonts are scaled up less than small ones. + | Type | Default | | ------- | ------- | | boolean | `true` |