Skip to content

After update to MIUI 12,Text is cut off #29259

Description

@jinshiyi11

Description

After update to MIUI 12, Text is cut off.
image
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
image

Activity

  1. xiaohui-hiwintech commented on Jul 1, 2020

    @xiaohui-hiwintech

    yeah, i have the same issue in miui 12 but it is fine in miui 10 and 9. Not sure it's a issue in react-native or miui.
    My rn version is 0.59.9.
    image
    The phone number and the word 'message' disappeared.

  2. jinshiyi11 commented on Jul 1, 2020

    @jinshiyi11
    Author

    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]);  
    
    };  
    

    `

  3. sapjax commented on Jul 3, 2020

    @sapjax

    This is caused by the default FontFamily of MIUI 12: "小米兰亭 PRO". It's a variable opentype Font, look like react-native doesn't support it.

  4. sapjax commented on Jul 3, 2020

    @sapjax

    @jinshiyi11
    What is your code to detect MIUI12 in isMiUi12?

  5. github-actions commented on Jul 8, 2020

    @github-actions
    ⚠️ Missing Environment Information
    ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.
  6. github-actions commented on Jul 8, 2020

    @github-actions
    ⚠️ 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.
  7. bashen1 commented on Jul 17, 2020

    @bashen1

    The same issue in miui 12

  8. Foveluy commented on Jul 21, 2020

    @Foveluy

    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

  9. AKB48 commented on Jul 22, 2020

    @AKB48
    Contributor

    It did work to set a default property - {fontFamily: ''} in style property of Text

  10. 6 remaining items

  11. inkCrazy commented on Jan 4, 2021

    @inkCrazy

    最后你们怎么解决问题的,RN0.62.2 小米10, MIUI12.0.8同样问题。

  12. magicismight commented on Jan 7, 2021

    @magicismight
    Contributor
    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
          ]);
        };
      }
    }
    
  13. inkCrazy commented on Jan 7, 2021

    @inkCrazy
    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里面,全局设置字体?

  14. hussainahmad commented on Mar 16, 2021

    @hussainahmad
    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?

  15. yorickshan commented on Nov 9, 2021

    @yorickshan

    fontFamily: 'System'

    it works for me

  16. zhuminjunivan commented on Mar 1, 2023

    @zhuminjunivan
  17. github-actions commented on Mar 25, 2023

    @github-actions

    This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

  18. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Mar 25, 2023
  19. github-actions commented on Apr 2, 2023

    @github-actions

    This issue was closed because the author hasn't provided the requested feedback after 7 days.

  20. locked as resolved and limited conversation to collaborators on Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions