V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
qq309187341
V2EX  ›  Vue.js

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

  •  
  •   qq309187341 · Sep 5, 2022 · 1264 views
    This topic created in 1332 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   ·   5419 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 07:44 · PVG 15:44 · LAX 00:44 · JFK 03:44
    ♥ Do have faith in what you're doing.