Repository navigation
After update to MIUI 12,Text is cut off #29259
Description
Activity
currently ,we hook Text render to make it work correctly.
`
const originTextRender = Text.render;Text.render = function render(props, ref) {
return originTextRender.apply(this, [{ ...props, style: [isMiUi12() ? {fontFamily:''} : null, props.style] }, ref]); };`
Reacted by Yousef Balout, Kurisu, Xiaohui, zhengchao, KingAmo, CodeBaker, TongMonkey, Blake, Super paul, soccc and 1 moreReacted by CodeBaker and BlakeThis is caused by the default FontFamily of MIUI 12: "小米兰亭 PRO". It's a
variable opentypeFont, look like react-native doesn't support it.Reacted by ettingshausen@jinshiyi11
What is your code to detect MIUI12 inisMiUi12?- addedNeeds: Environment InfoPlease run `react-native info` and edit your issue with that command's output.Please run `react-native info` and edit your issue with that command's output.
on Jul 8, 2020 ⚠️ Missing Environment Information ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native infoin a console.⚠️ Using Old Version ℹ️ It looks like you are using an older version of React Native. Please upgrade to the latest version, and verify if the issue persists. If it does not, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the current release. - removedNeeds: Environment InfoPlease run `react-native info` and edit your issue with that command's output.Please run `react-native info` and edit your issue with that command's output.
on Jul 8, 2020 The same issue in miui 12
currently ,we hook Text render to make it work correctly.
`
const originTextRender = Text.render;Text.render = function render(props, ref) {
return originTextRender.apply(this, [{ ...props, style: [isMiUi12() ? {fontFamily:''} : null, props.style] }, ref]); };`
cannot fix the problem
It did work to set a default property - {fontFamily: ''} in style property of Text
6 remaining items
最后你们怎么解决问题的,RN0.62.2 小米10, MIUI12.0.8同样问题。
if (Platform.OS === 'android' && NativeModules.PlatformConstants) { const fingerprint = NativeModules.PlatformConstants.Fingerprint; if (fingerprint?.match(/^(xiaomi|redmi|mi|mix|poco).*\/v12\..*/i)) { const originTextRender = Text.render; Text.render = function render(props, ref) { return originTextRender.apply(this, [ { ...props, style: [{ fontFamily: '' }, props.style] }, ref ]); }; } }if (Platform.OS === 'android' && NativeModules.PlatformConstants) { const fingerprint = NativeModules.PlatformConstants.Fingerprint; if (fingerprint?.match(/^(xiaomi|redmi|mi|mix|poco).*\/v12\..*/i)) { const originTextRender = Text.render; Text.render = function render(props, ref) { return originTextRender.apply(this, [ { ...props, style: [{ fontFamily: '' }, props.style] }, ref ]); }; } }这个是写在app.js里面,全局设置字体?
if (Platform.OS === 'android' && NativeModules.PlatformConstants) { const fingerprint = NativeModules.PlatformConstants.Fingerprint; if (fingerprint?.match(/^(xiaomi|redmi|mi|mix|poco).*\/v12\..*/i)) { const originTextRender = Text.render; Text.render = function render(props, ref) { return originTextRender.apply(this, [ { ...props, style: [{ fontFamily: '' }, props.style] }, ref ]); }; } }@magicismight where this code be put?
fontFamily: 'System'it works for me
Reacted by Alejandro and Shan YinlongReacted by Shan YinlongThis issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
- addedStaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
on Mar 25, 2023 This issue was closed because the author hasn't provided the requested feedback after 7 days.
- locked as resolved and limited conversation to collaborators
on Apr 2, 2023 - removedStaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
on Jun 9, 2023

Description
After update to MIUI 12, Text is cut off.

the actual text is QQ,but only Q is displayed
React Native version:
React Native version: 0.60.5
model: MI 10 Pro
android:10
MIUI:12.0.1
Fingerprint -> Xiaomi/cmi/cmi:10/QKQ1.191117.002/V12.0.1.0.QJACNXM:user/release-keys
Steps To Reproduce
updrade XiaoMi Phone's system to MIUI 12
Expected Results
full text is expected to display,like below
