// Regression: ligatures must not read as system-font glyphs. STAR DASH's "Outfits, ..." caption failed `shots check` // with `i drawn with a system font` although Montserrat drew every glyph: the per-character probe spans sat side by // side, Chrome shaped "f" + "i" into the fi ligature across them and the lone "i" span reported no glyph of ours. // The fixture is a real Google Fonts css2 `text=` subset of Montserrat (as `shots fonts` downloads it; OFL, see // fixtures/fonts/Montserrat-OFL.txt); it keeps the GSUB ligatures (ff, fi, ffi). Skips when no Chromium can launch. import { afterAll, describe, expect, test } from 'bun:test'; import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { measureFonts } from '../../cli/shots/glyphs'; import { AFTER_ALL_MS, launchTestBrowser, scaled } from '../helpers/browser'; // one browser for the file, launched and killed by the shared helper (bounded, load-aware timeouts); tools/ci-plan.ts // lists this file as HEAVY (the browser shard) const shared = await launchTestBrowser('playwright-core'); const { browser, skipWhy } = shared; if (!browser) console.warn(`glyph ligature test skipped: no Chromium installed (${skipWhy}). Run \`bunx playwright install chromium\`.`); afterAll(() => shared.close(), AFTER_ALL_MS); const font = readFileSync(join(import.meta.dir, '..', 'fixtures', 'fonts', 'montserrat-text-subset.woff2')).toString('base64'); const TEXT = 'Outfits, fit, office, affine'; describe.skipIf(!browser)('shots font usage: ligatures', () => { for (const weight of [400, 600, 800]) test(`"${TEXT}" in a Montserrat text= subset, weight ${weight}: zero system-font glyphs`, async () => { const page = await browser.newPage(); try { await page.setContent(`
${TEXT}