nguyenhuynghia / react-native-global-font

MIT License
46 stars 8 forks source link

Custom Font not working on android #1

Open Quadriphobs1 opened 7 years ago

Quadriphobs1 commented 7 years ago

I just installed this and all went well, i linked the custom font and its appear in the appropriate folder but whenever i launch the application i don't see my custom font working at all, i am using native base with react native and using react native router flux.

I don't seems to know what is wrong here i am using android emulator 22, any help please on this, i don't get any error when i launch the application though.

cmendes0101 commented 6 years ago

Are you setting fontWeight or fontStyle in your style of the text?

lagosnomad commented 6 years ago

I'm also having this issue, I'm not setting fontWeight or fontStyle either

cmendes0101 commented 6 years ago

Bummer, yah that was my issue. For iOS i had fontWeight and fontStyle and that broke it for Android.

Using this package to set a default fontFamily but to also cleanup fontWeight and fontStyle with these changes: https://github.com/cmendes0101/react-native-global-font/blob/master/index.js

Not sure if its PR worthy since my use case. Maybe give this a shot incase something in inheriting font styles: yarn add github:cmendes0101/react-native-global-font

cmendes0101 commented 6 years ago

also Android is a little more sensitive about font names. What font are you trying? If it's a multi file font family then you have to declare the fontFamily file specifically like Nunito-Regular and not Nunito

lagosnomad commented 6 years ago

Yea, I'm using the Brandon-Grotesque font, it's a multi file font family and i'm declaring the font family as BrandonGrotesque-Regular.