作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 react-native 中使用 google 自定义字体,但我遇到了问题,我从 google 下载了 OpenSans
字体并使用 react-native
配置了它正确。
字体文件OpenSans-VariableFont_wdth,wght.ttf
我正在尝试像这样使用它
{
fontSize: 18,
fontFamily:"OpenSans-Bold"
},
但我遇到了类似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>
src={ {html:xxxx, baseUrl: '' }}
originWhitelist={['*']}
关于react-native - 如何在 React-Native 中使用 Google 可变字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72629402/
我是一名优秀的程序员,十分优秀!