Open ranjkkum opened 5 months ago
Hey there, I had the same problem some weeks ago, installing the individual font families fixed this for me. I also had to remove 'fontWeight' property from all of my fonts' config. Example code below:
export const fonts {
titleLarge: {
fontFamily: 'RedHatDisplay-ExtraBold',
fontSize: 34,
letterSpacing: 0.37,
lineHeight: 41,
},
bodyMedium: {
fontFamily: 'RedHatDisplay-Medium',
fontSize: 16,
letterSpacing: 0.36,
lineHeight: 34,
},
bodySmall: {
fontFamily: 'RedHatDisplay-Regular',
fontSize: 14
letterSpacing: 0.35,
lineHeight: 46,
},
...
};
This way I set the fontWeight using the specific fontFamily I installed. I also tried using some variable fonts but it seems those aren't compatible yet.
So I'd try removing fontWeight from your fonts' config, and setting it just with fontFamily.
Here's another useful issue you could check: https://github.com/facebook/react-native/issues/42116
thanks for your response.. i tried removing fontWeight but somehow its still not working ..
Only other thing is I noticed you're importing Text
from "react-native". I don't know if you're also importing it that way in other modules but it should be imported from "react-native-paper". That way it'll properly use the fonts provided by your theme.
I am trying to install custom fonts to a react native paper theme. Looked at the example mentioned on https://github.com/callstack/react-native-paper/issues/3325 on the snack expo https://snack.expo.dev/@react-native-paper/font-styles-variants
i have implemented the below code after which the components picks up the fontFamily but the fontWeight does not change unless I specify the font family in the StyleSheet.
Can someone suggest what is wrong here.