callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.81k stars 2.08k forks source link

fontWeight and custom fontFamily are not working properly together. #4419

Open JieMin27 opened 4 months ago

JieMin27 commented 4 months ago

Current behaviour

I tried to use the Poppins font for my project. I found out that to make the font weight work, I can't set the base font family as 'Poppins'; instead, I need to declare it like fontFamily: 'Poppins-SemiBold' for it to work. However, for the font to work on iOS, I need to set up the fontWeight, but the fontWeight can only be set up to 600.

IOS Working: fontFamily: 'Poppins-Bold', fontWeight: '600',

Not Working: fontFamily: 'Poppins-Bold', fontWeight: '700',

Expected behaviour

How to reproduce?

Preview

What have you tried so far?

Your Environment

software version
react-native 0.74.0
react-native-paper 5.12.3
seb-zabielski commented 4 months ago

Hey @JieMin27 Can you check if the problem still occurs is if you use Text component from react-native?

JieMin27 commented 4 months ago

Hey @JieMin27 Can you check if the problem still occurs is if you use Text component from react-native?

The same issue occurs when using the Text component from React Native.

fontFamily: 'Poppins-Bold', fontWeight: '700',

In android, Poppins-Bold will be overwritten by system font when fontWeight is set to more than 600

seb-zabielski commented 4 months ago

It seems that the problem is not related to the library itself.

I would suggest you try:

  1. Check if Poppins-ExtraBold and Poppins-Black are also installed. Maybe not everything has been installed?
  2. Try another font and see what the result will be?
theprashant-one commented 1 month ago

Same issue