网上查了很多文章,都是说导入外部https链接,下文代码段xxxx为你下载的苹方字体导入到你们服务器上的链接,也就是这里我需要的苹方字体的链接
uni.loadFontFace({
family: "you",
source: 'url("https:xxxxxxx.ttf")',
global: true,
success() {
console.log("success")
},
fail(err) {
console.log(err)
},
complete(err) {
console.log(err)
},
})
然后并没有什么用
会造成字体导入错误,![]()
然后我自己琢磨了下,
@font-face {
font-family: 'PingFang-SC-Regular';
src: url("https:xxxxxxxxx.ttf");
}
html, body, input, view, textarea {
font-family: PingFang-SC-Regular;
}
代码如上,全局配置或者局部配置都行!!!

5180

被折叠的 条评论
为什么被折叠?



