Intent to Experiment: Enhanced Canvas TextMetrics

49 views
Skip to first unread message

Florin Malita

unread,
Nov 4, 2025, 3:11:07 PM (2 days ago) Nov 4
to blink-dev, Stephen Chenney, Rick Byers
Contact emails
jlav...@google.comandres...@chromium.orgfma...@chromium.orgsche...@chromium.org

Explainer
https://github.com/fserb/canvas2D/blob/master/spec/enhanced-textmetrics.md
https://github.com/Igalia/explainers/blob/main/canvas-formatted-text/text-metrics-additions.md
https://github.com/whatwg/html/issues/10677

Specification
https://github.com/whatwg/html/pull/11000

Summary
Expand the TextMetrics Canvas API to support selection rectangles, bounding box queries, and glyph cluster-based operations.

This new functionality should enable complex text editing applications with accurate selection, caret positioning, and hit testing. Additionally, cluster-based rendering facilitates sophisticated text effects such as independent character animations and styling.


Blink component
Blink>Canvas

Web Feature ID
No information provided

TAG review
https://github.com/w3ctag/design-reviews/issues/1095

TAG review status
Pending

Risks


Interoperability and Compatibility
These are new features and we will get vendor agreement at WHATWG before shipping. So minimal interop risks beyond platform-specific metrics differences.

Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1144)

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/436)

Web developers: Positive Developers want the ability to animated glyphs independendly (such as exploding sentences) and the ability to do e.g. selection on canvas text. The proposed APIs support these use cases and more.

Other signals:

Ergonomics
None.

Activation
None.

Security
There is always a fingerprinting concern with HTML canvas. THe new features expose no novel fingerprinting surface (text metrics are already a fingerprinting concern).

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No information provided


Goals for experimentation
Partners have implemented prototypes based on the available runtime feature, with positive feedback. They are now interested in expanding the scope, and testing the API with real users. This experiment will provide valuable validation in real-world use scenarios, and should help us gauge the proposed API's fitness, ergonomics, and performance.

Ongoing technical constraints
No information provided

Debuggability
DevTools supports querying the APIs by default.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes

Is this feature fully tested by web-platform-tests?
Yes
html/canvas/[element|offscreen]/text... 2d.text.measure.index-from-offset* 2d.text.measure.selection-rects* 2d.text.measure.text-clusters* https://wpt.fyi/results/html/canvas/element/text?label=master&label=experimental&aligned&q=tentative https://wpt.fyi/results/html/canvas/offscreen/text?label=master&label=experimental&aligned&q=tentative

Flag name on about://flags
Experimental Web Platform Features

Finch feature name
ExtendedTextMetrics

Requires code in //chrome?
False

Tracking bug
https://issues.chromium.org/issues/341213359

Measurement
UMA counters will be added for the new APIs.

Estimated milestones
Origin trial desktop first144
Origin trial desktop last149
DevTrial on desktop141
Origin trial Android first144
Origin trial Android last149
DevTrial on Android141


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5075532483657728?gate=5204916142080000

Links to previous Intent discussions
Intent to Prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADgYMVdqo4PBs4OkGqVncRizs8vtX4YtFLDcK%2BRxdYo_wnaRJQ%40mail.gmail.com
Ready for Trial: https://groups.google.com/a/chromium.org/g/blink-dev/c/OLCCI0ExvIk


This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Nov 5, 2025, 8:59:34 AM (23 hours ago) Nov 5
to Florin Malita, blink-dev, Stephen Chenney, Rick Byers
LGTM

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADgYMVfC-Naw8pFVaUUPMSfW-u3kC7SMdDeHJgwU5YmSHOOeeA%40mail.gmail.com.

Ashley Gullen

unread,
Nov 5, 2025, 9:09:15 AM (23 hours ago) Nov 5
to Florin Malita, blink-dev, Stephen Chenney, Rick Byers
Given that the existing TextMetrics are not interoperable (see https://github.com/web-platform-tests/interop/issues/1091), may I ask what is being done to ensure the new metrics will be interoperable?


--

Florin Malita

unread,
Nov 5, 2025, 9:55:27 AM (22 hours ago) Nov 5
to Ashley Gullen, blink-dev, Stephen Chenney, Rick Byers
On Wed, Nov 5, 2025 at 9:08 AM Ashley Gullen <ash...@scirra.com> wrote:
Given that the existing TextMetrics are not interoperable (see https://github.com/web-platform-tests/interop/issues/1091), may I ask what is being done to ensure the new metrics will be interoperable?

Hey Ashley!

The proposed API extensions are orthogonal to existing interop issues: we are not making any changes to how text is being shaped and rendered, nor are we changing the current TextMetrics values -- we are just surfacing additional information.  When the interop issues you've highlighted will get addressed, the extended metrics should seamlessly reflect the new/corrected values.

That said, I do agree that interop is important for Canvas text.  Trivial variations in text layout and metrics are somewhat expected, since browsers use wildly different text shaping stacks.  But major differences should be treated as implementation bugs.  I'll see if we can get some traction for those issues on our end.

Thanks,
Florin 

Reply all
Reply to author
Forward
0 new messages