|
|
@@ -291,10 +291,10 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
stylesheetContent += "}";
|
|
|
} else if (rule.type == CSSRule.FONT_FACE_RULE) {
|
|
|
if (rule.style) {
|
|
|
- const fontFamily = removeQuotes(rule.style.getPropertyValue("font-family"));
|
|
|
- if (fontFamily && !unusedFonts.find(fontInfo => fontInfo.familyName == fontFamily)) {
|
|
|
+ const familyName = removeQuotes(rule.style.getPropertyValue("font-family"));
|
|
|
+ if (familyName && !unusedFonts.find(fontInfo => fontInfo.familyName == familyName)) {
|
|
|
let optionalTest;
|
|
|
- const optionalUsedFonts = filteredUsedFonts && filteredUsedFonts.get(fontFamily);
|
|
|
+ const optionalUsedFonts = filteredUsedFonts && filteredUsedFonts.get(familyName);
|
|
|
if (optionalUsedFonts && optionalUsedFonts.length) {
|
|
|
const fontStyle = rule.style.getPropertyValue("font-style") || "normal";
|
|
|
const fontWeight = getFontWeight(rule.style.getPropertyValue("font-weight")) || "400";
|
|
|
@@ -309,7 +309,7 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
} else {
|
|
|
const usedFontWeights = optionalUsedFonts.map(fontInfo => fontInfo.fontWeight);
|
|
|
const declaredFontsWeights = declaredFonts
|
|
|
- .filter(fontInfo => fontInfo.familyName == fontFamily && fontInfo.fontStyle == fontStyle && (fontInfo.fontVariant == fontVariant || "normal" || fontInfo.fontVariant == fontVariant || "common-ligatures"))
|
|
|
+ .filter(fontInfo => fontInfo.familyName == familyName && fontInfo.fontStyle == fontStyle && (fontInfo.fontVariant == fontVariant || "normal" || fontInfo.fontVariant == fontVariant || "common-ligatures"))
|
|
|
.map(fontInfo => fontInfo.fontWeight)
|
|
|
.sort((w1, w2) => w1 - w2);
|
|
|
const usedComputedFontWeights = usedFontWeights.map(fontWeight => findFontWeight(fontWeight, declaredFontsWeights));
|