mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 17:42:41 +08:00
fix load ttf with md5 (#3016)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user