// 字体组
fonts:[{img:'../../images/dongfangdakai1.png',url:'url("https://hao.tinymomo.com/public/uploads/dongfangdakai.ttf")', family:'fangdazhengkai'}]
//点击加载
wx.loadFontFace({
global: true,
family: this.data.fonts[this.data.fontIndex].family,
source: this.data.fonts[this.data.fontIndex].url,
success(res){
console.log(res)
wx.hideLoading()
CanvasDrag.changeFamily(that.data.fonts[that.data.fontIndex].family)
}, fail(e) {
wx.hideLoading()
console.log(e)
}
})
// 版本 2.30.4 3.55 等等都不行
// canvas
<canvas
id="canvas-label"
canvas-id="canvas-label"></canvas>
// font设置 font = 'normal normal 18px fangyuanti'
this.ctx.font = this.italic + ' ' + this.weight + ' ' + parseInt(this.fontSize) + 'px ' + this.family
真机加载字体成功 loaded success
@Demons