openpencil/tests/helpers/fonts/runtime.ts
Danila Poyarkov b458e3c3ae perf(canvas): reuse labels with shared font fallback
Acquire section paragraphs once, reuse proven fitting layouts, and bound retained text with borrowed native-resource lifetimes. Share document text family selection and Arabic/CJK coverage resolution rather than preserving missing glyphs. Validate exact zoom parity with real existing font fixtures.
2026-09-15 23:08:53 +03:00

12 lines
415 B
TypeScript

import type { Page } from '@playwright/test'
const FONT_MODULE_RESOURCE_CAPACITY = 4096
/** Preserve the loaded font module URL even when the dev module graph exceeds the browser's default buffer. */
export async function trackFontModuleResources(page: Page): Promise<void> {
await page.addInitScript(
(capacity) => performance.setResourceTimingBufferSize(capacity),
FONT_MODULE_RESOURCE_CAPACITY
)
}