Skip to content

Commit d6930a0

Browse files
committed
Add ttc loader and prevent the pure digital fonts is invalid
1 parent 888c979 commit d6930a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/cocostudio/loader/parsers/timelineParser-2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@
547547
if (cc.sys.isNative) {
548548
fontName = cc.path.join(cc.loader.resPath, resourcePath, path);
549549
} else {
550-
fontName = path.match(/([^\/]+)\.ttf/);
550+
fontName = path.match(/([^\/]+)\.(\S+)/);
551551
fontName = fontName ? fontName[1] : "";
552552
}
553553
widget.setFontName(fontName);
@@ -1106,7 +1106,7 @@
11061106
if (cc.sys.isNative) {
11071107
fontName = cc.path.join(cc.loader.resPath, resourcePath, path);
11081108
} else {
1109-
fontName = path.match(/([^\/]+)\.ttf/);
1109+
fontName = path.match(/([^\/]+)\.(\S+)/);
11101110
fontName = fontName ? fontName[1] : "";
11111111
}
11121112
widget.setFontName(fontName);

0 commit comments

Comments
 (0)