From 0665cd764f30faea2f394fedf2167fe8104644e6 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH] =?UTF-8?q?test(browser):=20Firefox=EC=9D=98=20Pretendard?= =?UTF-8?q?=20name=20=ED=91=9C=20=EA=B2=BD=EA=B3=A0=20=ED=95=9C=20?= =?UTF-8?q?=EC=A4=84=EB=A7=8C=20=EB=B0=9B=EC=95=84=EB=93=A4=EC=9D=B8?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firefox는 번들된 pretendard 1.3.9 가변 폰트를 열 때마다 콘솔에 「downloadable font: name: name records are not sorted」 경고를 낸다. 브라우저 시험의 공용 fixture(strict-browser-test.ts)는 경고도 실패로 세므로, Firefox에서는 폰트를 쓰는 거의 모든 시험이 떨어진다. 2026-11-12 main(7853ff1d) 기준으로 FE-GATE-008 e2e의 Firefox 실패 143건 중 118건, capability 19건 전부, FE-GATE-009의 29건이 이것 하나뿐이었다. 경고는 폰트 파일 안 name 레코드의 순서를 말한다. Firefox의 폰트 검사기 (OTS)가 순서를 고치고 폰트를 그대로 쓴다. Chromium과 WebKit은 아무것도 내지 않는다. 그래서 이 경고 한 줄만 fixture에서 무시한다. 폰트 이름, 가중치 범위, 파일 이름까지 맞는 문장만 받는다. 폰트가 거부되면 「rejected by sanitizer」 같은 다른 문장이 나오고, 그것은 여전히 실패다. 버린 대안: 폰트를 다시 써서(fonttools로 저장) 정렬된 파일을 repo에 두기. npm 패키지 대신 고친 바이너리를 직접 관리하게 되고, 패키지를 올릴 때마다 다시 만들어야 한다. 위험: Pretendard를 다른 판으로 바꿔 경고 문장이 달라지면 이 정규식이 맞지 않아 다시 실패한다. 그때는 그 문장을 보고 판단한다. 검증 (desktop, Playwright 1.62, CI env): - Firefox에서 빌드한 앱: Pretendard Variable status "loaded", document.fonts.check('16px "Pretendard Variable"') true, h1 글꼴 Pretendard Variable. 경고는 그대로 한 줄 나온다. - test:browser-capabilities: Firefox 실패 19건 → 0건. --- tests/support/browser/strict-browser-test.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/support/browser/strict-browser-test.ts b/tests/support/browser/strict-browser-test.ts index e84891d..edde745 100644 --- a/tests/support/browser/strict-browser-test.ts +++ b/tests/support/browser/strict-browser-test.ts @@ -5,10 +5,22 @@ import { type Page, } from "@playwright/test"; +/** + * Firefox's font sanitizer (OTS) reports that the `name` table of the bundled + * `pretendard` 1.3.9 variable font lists its records out of order. It sorts + * them itself and the font still loads (`document.fonts.check` is true in + * Firefox); Chromium and WebKit say nothing. The file is the npm package's, not + * ours. Only this exact warning for this font is ignored: a font the sanitizer + * rejects logs a different line and still fails. + */ +const FIREFOX_PRETENDARD_NAME_ORDER = + /^\[JavaScript Warning: "downloadable font: name: name records are not sorted\. \(font-family: "Pretendard Variable" style:normal weight:45\.\.920 stretch:100 src index:0\) source: http:\/\/127\.0\.0\.1:\d+\/[\w./@-]*PretendardVariable(?:-[\w-]+)?\.woff2"\]$/u; + function ignoredConsole(message: ConsoleMessage) { return ( message.type() === "warning" && - message.text().includes("NO_COLOR") + (message.text().includes("NO_COLOR") || + FIREFOX_PRETENDARD_NAME_ORDER.test(message.text())) ); }