estimateTextSize() now tries opentype.js per-glyph advance widths before falling back to the rough 0.6 × fontSize × charCount heuristic. Since font data is already cached via loadFont(), this gives accurate variable-width measurement for any loaded font — no CanvasKit needed. Parsed opentype.js Font objects are cached per family+style to avoid reparsing on every layout pass. |
||
|---|---|---|
| .. | ||
| assets | ||
| src | ||
| package.json | ||
| tsconfig.json | ||
| tsdown.config.ts | ||