阅读 57

小程序canvas加载网络字体

    wx.loadFontFace({
family: 'Ping Fang',

source:
'url("http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf")',

success: function (res) {
console.log('字体加载成功'); // loaded
that.init();
},

fail: function (res) {
console.log('字体加载失败'); // erro
},

complete: function (res) {
console.log('加载完成');
}
});