Jos*_*i G 5 fonts react-native google-fonts
我正在尝试在react-native中使用谷歌自定义字体,但遇到问题,我OpenSans从谷歌下载了字体并正确配置了它react-native。
字体文件
OpenSans-VariableFont_wdth,wght.ttf
我想用它
{
fontSize: 18,
fontFamily:"OpenSans-Bold"
},
Run Code Online (Sandbox Code Playgroud)
但我遇到了类似的问题Unrecognized font family 'OpenSans-Bold'。但如果我给予喜欢,它就会起作用OpenSans-Regular。
我怎样才能使用这个文件OpenSans-VariableFont_wdth,wght.ttf
这就是我的方式
<style>@font-face {font-family: "OpenSans-Regular";src: url("OpenSans-VariableFont_wght.ttf");}</style>Run Code Online (Sandbox Code Playgroud)
src={ {html:xxxx, baseUrl: '' }}
originWhitelist={['*']}Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
966 次 |
| 最近记录: |