Skip to content

Measure web font text with canvas measureText - #746

Open
jph00 wants to merge 1 commit into
plotters-rs:masterfrom
AnswerDotAI:master
Open

jph00 wants to merge 1 commit into
plotters-rs:masterfrom
AnswerDotAI:master

Conversation

@jph00

@jph00 jph00 commented Oct 6, 2026

Copy link
Copy Markdown

Fixes #482. Completes #664 with the canvas-element fallback that @AaronErhardt agreed to merge.

In a Web Worker, estimate_layout panicked at window().unwrap(). It now measures with measureText on an OffscreenCanvas, or on a canvas element where OffscreenCanvas doesn't exist. A failed measurement returns FontError.

@jph00

jph00 commented Oct 6, 2026

Copy link
Copy Markdown
Author

cc @jwagner, who did #664.

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.

[Feature Request] Available in WebAssembly within web worker

1 participant