Closed vincent-cihan closed 1 year ago
It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the amount of issues we receive, we're currently accepting only new issues against one of the supported version. Please open your issue on StackOverflow to get further community support.
Thanks for your reply. I have not found any support for encoding format setting of Text component in the current and later versions. I would like to ask if there is any solution or support plan for later versions.
Thanks for your reply. I have not found any support for encoding format setting of Text component in the current and later versions. I would like to ask if there is any solution or support plan for later versions.
Sadly, we don't backport fixes to older versions of RN as we're a really small team and our capacity is limited. As you confirmed that this issue is fixed in the latest version of RN, this issue can now be closed
Description
In my APP, I import ttf fonts using ICONS through fontFamily and it always works fine. Recently, in the latest version of Samsung OS (oneui5.0), inconsistencies occur when bold characters are set in the system Settings. After experiments, it was found that the problem was caused by coding format, which could be solved by StandardCharsets.UTF_8, but I could not change the code in react-native. Thanks for your help and guidance. The modified code of my experiment is as follows:
public static void showIcon(TextView view) { Typeface font = Typeface.createFromAsset(view.getContext().getAssets(), "iconfont.ttf"); view.setTypeface(font); String iconText = view.getResources().getString(R.string.mine); iconText = new String(iconText.getBytes(StandardCharsets.UTF_8)); view.setText(iconText); }
Version
0.63.3
Output of
npx react-native info
NA
Steps to reproduce
Import custom icon fonts and open bold in the latest version of Samsung System Settings
Snack, code example, screenshot, or link to a repository
<Text selectable={false} style={[style,{ fontFamily: 'iconfont' }]}> {String.fromCharCode(parseInt('e96a', 16))} </Text>