Jelajahi Sumber

fixed format testing

Gildas 7 tahun lalu
induk
melakukan
82a9f04a3f
1 mengubah file dengan 5 tambahan dan 4 penghapusan
  1. 5 4
      lib/single-file/css-fonts-minifier.js

+ 5 - 4
lib/single-file/css-fonts-minifier.js

@@ -188,10 +188,11 @@ this.fontsMinifier = this.fontsMinifier || (() => {
 		if (woffFontFound || woff2FontFound) {
 			fontSources = fontSources.filter(fontSource => woff2FontFound ? fontTest(fontSource, "woff2") : fontTest(fontSource, "woff"));
 		} else {
-			const otfFontFound = fontSources.find(fontSource => fontTest(fontSource, "otf"));
-			const ttfFontFound = fontSources.find(fontSource => fontTest(fontSource, "ttf"));
-			if (otfFontFound || ttfFontFound) {
-				fontSources = fontSources.filter(fontSource => otfFontFound ? fontTest(fontSource, "otf") : fontTest(fontSource, "ttf"));
+			const otfFontFound = fontSources.find(fontSource => fontTest(fontSource, "opentype"));
+			const otfAltFontFound = fontSources.find(fontSource => fontTest(fontSource, "embedded-opentype"));
+			const ttfFontFound = fontSources.find(fontSource => fontTest(fontSource, "truetype"));
+			if (otfFontFound || otfAltFontFound || ttfFontFound) {
+				fontSources = fontSources.filter(fontSource => otfFontFound ? fontTest(fontSource, "opentype") : otfAltFontFound ? fontTest(fontSource, "embedded-opentype") : fontTest(fontSource, "truetype"));
 			}
 		}
 		stats.fonts.discarded -= fontSources.length;