react-native
react-native copied to clipboard
FontStyle 'italic' not working on iOS
Description
Hi! I'm using so many different texts in my app. Some with the react-native-render-html. But when I have to use fontStyle: 'italic', it's not working on iOS (even in the <Text> component).
In android it works perfectly, but in iOS not workin (custom os default fonts).
I extreme need the Italic fonts =(
React Native Version
0.70.6
Output of npx react-native info
Steps to reproduce
Snack, code example, screenshot, or link to a repository
<Text style={{ fontStyle: 'italic' }} >Italic</Text>
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, 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 most recent releases. |
Yes I have some problem, loading italic on iOS. Android is showing fine. @Girum do u able to find any solutions?
I have some problem
my problem was caused by the ttf file used wasn't having the correct full name as the font name.
make sure the ttf file u used has the correct full name as ur font name.
I have the same problem.
Inter Italic
font is not working as expected only on iOS devices
We have all this variants, and only Inter Italic
is not working as expected 🫠
Bumping into the same problem!
🎉 Found solution for my rn project
First step always is to run
npx react-native-asset
for rn > 0.69
Solution 1) Check font target membership (worked for me)
- Open your /ios folder with Xcode
- Clic on your project folder icon 2.1) Go to /Resources 2.2) Clic on your italic font name ( in my case is Roboto-Italic )
- Configure the target membership of your font
3.1) Select all targets ( I only had the development environment selected 🫠 )
Solution 2) Edit font name in case you have more than 3 variants of the same font
This solution is useful in case you have more than 3 variants of the same font, for example your project works with Inter font and you have installed
- Inter-Medium
- Inter-Regular
- Inter-SemiBold
- Inter-Italic
In this case, you have more than 3 variants of the same font, and you need to choose one of them, and use something like FontForge to change the font name in order to avoid this iOS restriction of the maximum number of font variants
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.