From babbc3e43cf0a855186a91d3c6b615a1cd940d94 Mon Sep 17 00:00:00 2001 From: lizhiqiang05 Date: Mon, 25 Sep 2023 20:07:06 -0700 Subject: [PATCH] fix: Text cut off issues when adjusting text size and font weight in system settings (#39581) Summary: Fix Text cut off issues when adjusting text size and font weight in system settings. This pr fixed the problem that can be reproduced with the [snack](https://snack.expo.dev/fl5DSrLBJ) on Xiaomi devices with MIUI13 and MIUI14. The problem is shown as the image below: the number "999" is cut off and only "99" is rendered. text-cutoff-when-scaling-miui14 The problem is produced with setting font scaling in system settings like the image below shows. settings This text cut off case can be avoided by setting [`allowFontScaling`](https://reactnative.cn/docs/text#allowfontscaling) to false. But this pr can make it no matter what value `allowFontScaling` is set. The root cause of this case, according to MIUI developers, is that Misans typeface, as a variable font which will adjust the weight of different font axes with different font size, gets different widths when Text is measured and drawn for a bug in the framework of MIUI rom. They will fix this bug in next version while this pr fixed it in old versions. ## Changelog: [ANDROID][FIXED]-Fix Text cut off issues when adjusting text size and font weight in system settings.