* chore: remove unused pi context file - Delete .pi/context.md - Remove an unused local context artifact from the repository * Add clipboard text v4 export * fix(clipboard): rebase v4 export branch onto master - Resolve conflicts after the core text module reorganization - Fix clipboard text export imports and bundled font asset loading - Update raw binary expectations for textUserLayoutVersion 4 - Re-run check and unit tests after the rebase
22 lines
824 B
TypeScript
22 lines
824 B
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
|
|
import { fetchBundledFont, markFontLoaded, probeGlyphOutlineCommands } from '@open-pencil/core'
|
|
|
|
describe('clipboard text outline probe', () => {
|
|
test('lazy-loads opentype.js and extracts glyph commands from a loaded font', async () => {
|
|
const font = await fetchBundledFont('/Inter-Regular.ttf')
|
|
expect(font).toBeTruthy()
|
|
if (!font) return
|
|
|
|
markFontLoaded('Inter', 'Regular', font)
|
|
|
|
const probe = await probeGlyphOutlineCommands('Inter', 'Regular', 'Hello', 16)
|
|
expect(probe).toBeTruthy()
|
|
expect(probe?.family).toBe('Inter')
|
|
expect(probe?.style).toBe('Regular')
|
|
expect(probe?.unitsPerEm).toBeGreaterThan(0)
|
|
expect(probe?.commandCount).toBeGreaterThan(0)
|
|
expect(probe?.firstGlyphCommandSample.length).toBeGreaterThan(0)
|
|
})
|
|
})
|