From 8aa3fac898b24a47b134972a00d76a5d37d88fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=A0=E6=89=8B=E6=8D=A7=E9=B2=9C=E8=8A=B1?= <157215725@qq.com> Date: Sat, 18 Mar 2023 23:39:57 +0800 Subject: [PATCH] fix: font-family is case insensitive (#14) --- src/clone-node.ts | 1 + src/embed-web-font.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/clone-node.ts b/src/clone-node.ts index 37bf0fc..cd08ec1 100644 --- a/src/clone-node.ts +++ b/src/clone-node.ts @@ -100,6 +100,7 @@ export async function cloneNode( cloneStyle.getPropertyValue('font-family') .split(',') .filter(Boolean) + .map(val => val.toLowerCase()) .forEach(val => fontFamilies.add(val)) copyPseudoContent(node, clone, ownerWindow) diff --git a/src/embed-web-font.ts b/src/embed-web-font.ts index e7487a3..e89f51a 100644 --- a/src/embed-web-font.ts +++ b/src/embed-web-font.ts @@ -81,6 +81,7 @@ export async function embedWebFont( && cssRule.style.getPropertyValue('font-family') .split(',') .filter(Boolean) + .map(val => val.toLowerCase()) .some(val => fontFamilies.has(val)) )) .forEach((value) => {