Reputation: 692
As in css , we can set like this :
font-family:"Times New Roman",Georgia,Serif;
But in RN , we can just set one font ,
fontFamily: 'MidPlane00v3.1',
How can we use it like css? I need to show multiple bytes Chinese words using font rollback mechanism!
Upvotes: 13
Views: 6498
Reputation: 1938
You can't set font-family
in react-native like you would in CSS. This is because in CSS what's happening is that the browser will try to fetch the first font-family
and in case it can't it will try the next defined alternative, like stated in W3 Schools
In react-native, this isn't an issue because you'll add the font-family
to the app's native assets folder, guarantying the font-family
's presence on the app. If you want a further explanation on why, you can take a look at React Native documentation.
And if you want to know how to add custom font-family to the project, you can follow this guide
Upvotes: 1