Skip to content

test: font-embedding regression check (data:-URI + CDN)#4

Merged
mmoollee101-lab merged 1 commit into
mainfrom
feat/font-embed-regression-test
Jul 16, 2026
Merged

test: font-embedding regression check (data:-URI + CDN)#4
mmoollee101-lab merged 1 commit into
mainfrom
feat/font-embed-regression-test

Conversation

@mmoollee101-lab

Copy link
Copy Markdown
Owner

Follow-up to #2 — a regression guard so the font-embedding failures can't silently return. Full PDCA cycle (plan/design/analysis/report under docs/).

What it checks

Drives the public API (convertHtmlToPptx) end-to-end and asserts on the output .pptx bytes:

  • ppt/fonts non-empty
  • embeddedFontLst has the family with Regular AND Bold
  • every embedded EOT's cmap covers Korean ( U+AC00)
  • a byte-size floor rejects the 31 KB unicode-range subset trap

Two cases

  • R1 — offline: self-contained 5.6 KB fixture inlining a ~1.7 KB Pretendard subset as a data:font/woff2 URI (OFL-1.1, attributed in test/fixtures/NOTICE.md; regenerate via scripts/gen-font-fixture.js).
  • R2 — network-gated: reuses samples/sample.html (Noto Sans KR CDN); skips loudly if the CDN is unreachable, but a real embed failure while online still fails.

Wiring

  • npm run test:fonts (zero new deps — node:test + jszip + fonteditor-core).
  • New CI job font-embed launches real Chromium; the fast lint/load matrix stays browser-free.

Verification

  • npm test → 2 pass / 0 fail.
  • Proven to catch regressions: neutralizing the data:-URI embed makes R1 fail with no embedded fonts (ppt/fonts empty).
  • Gap analysis (bkit gap-detector): ~98% design match.

Guards the two failure modes fixed in #2 so they can't silently return:
  R1  a woff2 font inlined as a data: URI must be embedded (offline)
  R2  a CDN font must embed FULL, not a unicode-range subset (network-gated)

node:test suite drives the public API (convertHtmlToPptx) end-to-end and
asserts on the output .pptx bytes: ppt/fonts non-empty, embeddedFontLst has
Regular AND Bold, every embedded EOT's cmap covers Korean, and a byte-size
floor rejects the 31 KB subset trap. Zero new dependencies (node:test +
jszip + fonteditor-core, all already present).

The R1 fixture is a self-contained 5.6 KB HTML deck inlining a ~1.7 KB
Pretendard subset (OFL-1.1, attributed in test/fixtures/NOTICE.md), produced
by scripts/gen-font-fixture.js. R2 reuses samples/sample.html (Noto Sans KR)
and skips loudly when the CDN is unreachable.

Runs via `npm run test:fonts`, wired into CI as a dedicated `font-embed`
job that launches real Chromium (the fast lint/load matrix stays browser-
free). Verified: both cases pass, and neutralizing the data:-URI embed makes
R1 fail with "no embedded fonts (ppt/fonts empty)".

Includes the full PDCA record (plan/design/analysis/report) for the feature.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmoollee101-lab
mmoollee101-lab merged commit c7fbdcf into main Jul 16, 2026
4 checks passed
@mmoollee101-lab
mmoollee101-lab deleted the feat/font-embed-regression-test branch July 16, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant