react-native icon indicating copy to clipboard operation
react-native copied to clipboard

FontStyle 'italic' not working on iOS

Open Girum opened this issue 1 year ago • 8 comments

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).

Screenshot 2023-05-05 at 11 02 00

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>

Girum avatar May 05 '23 14:05 Girum

: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.

github-actions[bot] avatar May 05 '23 14:05 github-actions[bot]

Yes I have some problem, loading italic on iOS. Android is showing fine. @Girum do u able to find any solutions?

aliceInWahed avatar Jun 20 '23 04:06 aliceInWahed

I have some problem

Qyohu avatar Aug 09 '23 02:08 Qyohu

my problem was caused by the ttf file used wasn't having the correct full name as the font name. Screenshot 2023-08-09 at 12 21 46 PM

make sure the ttf file u used has the correct full name as ur font name.

aliceInWahed avatar Aug 09 '23 04:08 aliceInWahed

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 🫠 Captura de pantalla 2023-11-07 a las 18 52 56

jvegax avatar Nov 07 '23 17:11 jvegax

Bumping into the same problem!

ArseniiLyzenko avatar Nov 10 '23 09:11 ArseniiLyzenko

🎉 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)

  1. Open your /ios folder with Xcode
  2. 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 )

1

  1. Configure the target membership of your font 3.1) Select all targets ( I only had the development environment selected 🫠 ) Captura de pantalla 2023-11-17 a las 12 40 34

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

jvegax avatar Nov 17 '23 11:11 jvegax

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.

github-actions[bot] avatar May 16 '24 05:05 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar May 23 '24 05:05 github-actions[bot]