Gildas преди 7 години
родител
ревизия
e7200327fd
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      lib/single-file/css-fonts-minifier.js

+ 2 - 2
lib/single-file/css-fonts-minifier.js

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