Loading custom font won't work
I am trying to load a custom font to React Native but it just doesn't work.
I have the file gerstnerbq_bold.tff
when I open it it says on the left top corner Font name: Gerstner BQ
I put this file in androidappsrcmainassetsfonts
and used this in the CSS fontFamily: 'Gerstner Original Bold',
I did try every other combination for fontFamily but it just doesn't work.
I also restarted the server with react-native run-android but still no success.
The problem was apparently because I was using fontWeight
. When using fontWeight
then fontFamily
doesn't work for me.
Yeah I've actually had this issue before. Only some fonts have font weight enabled on android. If you use a font that doesn't then React-Native will use the default font.
链接地址: http://www.djcxy.com/p/59808.html上一篇: Android版/桌面版Chrome上的“Avenir”字体呈现不同
下一篇: 加载自定义字体将不起作用