I have configured my custom font like this:
added the .ttf files in ./shared/assets/fonts and in the font.js I have declared the type and size of the font:
const type = {
bold: 'AlbertSans-Bold’,
light: 'AlbertSans-Light',
medium: 'AlbertSans-Medium',
regular: 'AlbertSans-Regular',
};
const size = {
h1: 38,
input: 18,
regular: 17,
regularSmall: 16,
medium: 14,
small: 12,
tiny: 8.5,
};
My react-native.config.js is:
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./shared/assets/fonts'],
};
and I have linked the fonts with the command npx react-native-asset.
When I style my Text :
<Text style={{fontFamily: Fonts.type.bold, fontSize: Fonts.size.h4}}>
Hello
</Text>
The font type is not affected on ios but only on android. I have checked the postscript name of the font in the fontbook but it is the same as the .ttf files I have added. What could be the problem?