Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29743

React Native custom fonts working on IOS but not on Android

$
0
0

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


Viewing all articles
Browse latest Browse all 29743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>