Re: [w3ctag/design-reviews] Canvas Text Metrics for Editing, Art and Design (Issue #1095)

matatk left a comment (w3ctag/design-reviews#1095)

Thanks for the updates to the explainer @fmalita, and apologies for the delay in our reply.

The central challenge here is one that we have discussed earlier in the thread, that there are two approaches: one, enhancing TextMetrics, is low-level, and not accessible by default; the other, HTML-in-canvas, will be high-level and expected to be accessible, but the current proposal does not allow the advanced text shaping that is required for the use cases you cite (and it's not ready yet).

We feel it is most appropriate to ship the high-level API first, so that people who _can_ use it will do so, and the results will be more accessible by default. Our concern is that shipping the low-level approach will encourage everyone to use it, so when HTML-in-canvas _does_ exist, it will not be adopted.

After HTML-in-canvas _does_ ship, we have two options:

* Extend the HTML-in-canvas approach to support the text shaping cases you require.

  We suspect it will be possible to design an alternative to the [`drawElementImage()`](https://github.com/WICG/html-in-canvas?tab=readme-ov-file#2-drawelementimage-and-webglwebgpu-equivalents) API that allows developers to measure a tree separately from drawing its clusters to the canvas.

* Introduce these low-level API enhancements (if the high-level one cannot be extended to support this feature) for those who need it.

We understand that this introduces a dependency on HTML-in-canvas' progress, but we feel that it _must_ be the starting point, for the reasons outlined above.

We also heard an indication that it might be worth shipping this before HTML-in-canvas because of internationalization benefits, but we don't see those described in the explainer. If you do feel like that's a strong argument, could you describe it in the explainer and [ask the Internationalization WG to review it](https://www.w3.org/International/i18n-drafts/pages/review-request.en)?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1095#issuecomment-3714239181
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1095/3714239181@github.com>

Received on Tuesday, 6 January 2026 10:51:39 UTC