V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
qq309187341
V2EX  ›  Vue.js

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

  •  
  •   qq309187341 · 2022-09-05 15:45:06 +08:00 · 726 次点击
    这是一个创建于 598 天前的主题,其中的信息可能已经有所发展或是发生改变。

    // 检验字体是否已经安装 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 中展示正常。但是在手机上访问就无法正常加载字体了

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3484 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:15 · PVG 19:15 · LAX 04:15 · JFK 07:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.