I've added the Google Font Fira Sans fonts (Italic, Bold, Regular), following the react-native link
procedure.
I can see the fonts have been copied to src/main/assets/fonts
, likewise in Resources
folder for IOS
The fonts work fine on IOS but on android only Bold works but the Italic or Regular or any other font it doesnt work.
I have tried to set the fontFamily
to the name property of the font but still no change
This is how I set my font variable
export const Fonts = {
//Working on IOS but not on Android
//I have tried `FiraSans-Italic` `Fira Sans Italic` and nothing works
FiraSansItalic: (Platform.OS === 'ios') ? "FiraSans-Italic" : 'Fira Sans Italic',
//Bold works fine for both platforms
FiraSansBold: (Platform.OS === 'ios') ? "FiraSans-Bold" : "FiraSans-Bold"
}
Any ideas what could be wrong?
Thank you
const FiraSans = (Platform.OS === 'ios') ? 'Fira Sans' : 'FiraSans.ttf';
(this is a comment provided without seeing the actual code). – Samuli Hakoniemi(Platform.OS === 'ios') ? "FiraSans-Italic" : 'FiraSans-Italic.ttf
, I did try to put the file extension like you have it but still no luck – EmadFira Sans Italic
, but even if I name the fontFamily like that it doesnt work – Emad