|
@@ -62,7 +62,7 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
filteredUsedFonts = new Map();
|
|
filteredUsedFonts = new Map();
|
|
|
fontsInfo.used.forEach(fontNames => fontNames.forEach(familyName => {
|
|
fontsInfo.used.forEach(fontNames => fontNames.forEach(familyName => {
|
|
|
if (fontsInfo.declared.find(fontInfo => fontInfo.fontFamily == familyName)) {
|
|
if (fontsInfo.declared.find(fontInfo => fontInfo.fontFamily == familyName)) {
|
|
|
- const optionalData = options.usedFonts && options.usedFonts.filter(fontInfo => fontInfo.fontFamily == familyName);
|
|
|
|
|
|
|
+ const optionalData = options.usedFonts && options.usedFonts.filter(fontInfo => fontInfo[0] == familyName);
|
|
|
filteredUsedFonts.set(familyName, optionalData);
|
|
filteredUsedFonts.set(familyName, optionalData);
|
|
|
}
|
|
}
|
|
|
}));
|
|
}));
|
|
@@ -117,8 +117,8 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
removedRules.push(cssRule);
|
|
removedRules.push(cssRule);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
removedRules.forEach(cssRule => cssRules.remove(cssRule));
|
|
removedRules.forEach(cssRule => cssRules.remove(cssRule));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -133,7 +133,7 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
.filter(fontInfo => fontInfo.fontFamily == familyName && fontInfo.fontStyle == fontStyle && testFontVariant(fontInfo, fontVariant))
|
|
.filter(fontInfo => fontInfo.fontFamily == familyName && fontInfo.fontStyle == fontStyle && testFontVariant(fontInfo, fontVariant))
|
|
|
.map(fontInfo => fontInfo.fontWeight)
|
|
.map(fontInfo => fontInfo.fontWeight)
|
|
|
.sort((weight1, weight2) => weight1 - weight2);
|
|
.sort((weight1, weight2) => weight1 - weight2);
|
|
|
- const usedFontWeights = optionalUsedFonts.map(fontInfo => findFontWeight(fontInfo.fontWeight, declaredFontsWeights));
|
|
|
|
|
|
|
+ const usedFontWeights = optionalUsedFonts.map(fontInfo => findFontWeight(fontInfo[1], declaredFontsWeights));
|
|
|
test = usedFontWeights.includes(fontWeight);
|
|
test = usedFontWeights.includes(fontWeight);
|
|
|
} else {
|
|
} else {
|
|
|
test = true;
|
|
test = true;
|