移动端使用 new FontFace 加载第三方字体无效

2022-09-05 15:45:06 +08:00
qq309187341  qq309187341

// 检验字体是否已经安装 if (document.fonts.check(16px ${item.name})) { this.drawArr[index].fontType = ${item.name} } else { uni.showLoading({ title: '字体加载中...' }); const myFont = new FontFace(${item.name}, url(${item.url})) let font = await myFont.load(); document.fonts.add(font) this.drawArr[index].fontType = ${item.name} uni.hideLoading(); }

如题,canvas 中移动端使用此方法无效。求解决。我的 canvas 画板需要支持第三方字体。现在 chrome 中展示正常。但是在手机上访问就无法正常加载字体了

909 次点击
所在节点   Vue.js  Vue.js
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/877831

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX