Closed leecade closed 8 years ago
UPDATE
Now, we can use react-native link
to link assets
Create an assets
folder in your project root then define it in package.json
:
"rnpm": {
"assets": ["assets"]
},
Then run react-native link
, both iOS / Android font will be handled as assets, use the name as fontFamily
ref:
customFont.ttf
package into project:
https://medium.com/@dabit3/adding-custom-fonts-to-react-native-b266b41bff7f#.pxrg4l2ta
then, usage:
put the font file into
assets/fonts
then, usage:
And, the way to modif the
Text.prototype.render
to batch handlefontFamily