Hey,
I’m having an issue with imported fonts not rendering the correct weight, despite the individual font file working correctly.
I’m going to be as descriptive as I can because I have a feeling its something silly I’m doing wrong:
- The font is
AvenirNext
. I load it in b/c I want it for both Android / iOS - I have a file that requires all the font weights like so:
'AvenirNext-Bold': require('../assets/fonts/AvenirNext-Bold.ttf'),
'AvenirNext-BoldItalic': require('../assets/fonts/AvenirNext-BoldItalic.ttf'),
'AvenirNext-DemiBold': require('../assets/fonts/AvenirNext-DemiBold.ttf'),
- I use
Expo.Font.loadAsync(FONTS)
to load them:
await Promise.all([
Expo.Font.loadAsync(FONTS),
this._loadAssetsAsync(),
this._checkForInitialRoute()
])
- I know that
fontWeight
,fontStyle
don’t work with imported fonts so I use them as directed:
title: {
fontFamily: 'AvenirNext-DemiBold',
fontSize: 19
}
While creating a mock up of this in Sketch, I noticed that DemiBold is actually loading the Bold file.
If I open the AvenirNext-DemiBold in my assets/fonts
folder, its loading the correct font weight. It’s just not represented in the app.
Can it be a naming thing?
Is the font file corrupt?
Am I going crazy?
Any help would be appreciated!
Thanks!