qq309187341
V2EX  ›  Vue.js

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

  •  
  •   qq309187341 · Sep 5, 2022 · 1323 views
    This topic created in 1372 days ago, the information mentioned may be changed or developed.

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

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1025 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:34 · PVG 06:34 · LAX 15:34 · JFK 18:34
    ♥ Do have faith in what you're doing.