|
|
@@ -126,8 +126,8 @@ this.docHelper = this.docHelper || (() => {
|
|
|
styles.forEach(style => {
|
|
|
const fontFamilyNames = style.fontFamily.split(",");
|
|
|
fontFamilyNames.forEach(fontFamilyName => {
|
|
|
- fontFamilyName = removeQuotes(fontFamilyName.trim()).toLowerCase();
|
|
|
- if (!loadedFonts || loadedFonts.find(font => font.family.toLowerCase() == fontFamilyName && font.style == style.fontStyle && font.variant == style.fontVariant)) {
|
|
|
+ fontFamilyName = normalizeFontFamily(fontFamilyName);
|
|
|
+ if (!loadedFonts || loadedFonts.find(font => normalizeFontFamily(font.family) == fontFamilyName && font.style == style.fontStyle && font.variant == style.fontVariant)) {
|
|
|
const { fontWeight, fontStyle, fontVariant } = style;
|
|
|
usedFonts.add([fontFamilyName, fontWeight, fontStyle, fontVariant]);
|
|
|
}
|
|
|
@@ -136,6 +136,10 @@ this.docHelper = this.docHelper || (() => {
|
|
|
return Array.from(usedFonts);
|
|
|
}
|
|
|
|
|
|
+ function normalizeFontFamily(fontFamilyName) {
|
|
|
+ return removeQuotes(fontFamilyName.trim()).toLowerCase();
|
|
|
+ }
|
|
|
+
|
|
|
function getElementsInfo(win, element, elementsInfo = new Map()) {
|
|
|
const elements = Array.from(element.childNodes).filter(node => !win || node instanceof win.Element);
|
|
|
elements.forEach(element => {
|