fix load ttf with md5 (#3016)

This commit is contained in:
PP
2018-07-26 17:14:51 +08:00
committed by pandamicro
parent 8daee8cd31
commit f74f36ca23
2 changed files with 4 additions and 4 deletions
+4
View File
@@ -149,6 +149,10 @@ module.exports = {
if (!comp.font) return false;
let url = comp.font.nativeUrl;
var md5Pipe = cc.loader.md5Pipe;
if (md5Pipe) {
url = md5Pipe.transformURL(url, true);
}
if (CC_WECHATGAME) {
_fontFamily = wx.loadFont(url);
//avoid the error in wechat devtool platform
-4
View File
@@ -60,10 +60,6 @@ var CustomFontLoader = {
loadTTF: function (url, callback) {
var fontFamilyName = this._getFontFamily(url);
var md5Pipe = cc.loader.md5Pipe;
if (md5Pipe) {
url = md5Pipe.transformURL(url, true);
}
//these platforms support window.FontFace, but it sucks sometimes.
var useFontFace = (cc.sys.browserType !== cc.sys.BROWSER_TYPE_BAIDU
&& cc.sys.browserType !== cc.sys.BROWSER_TYPE_BAIDU_APP