Contact emails
yi...@chromium.org, fs...@chromium.org
Spec
https://html.spec.whatwg.org/multipage/canvas.html#textmetrics
We are launching the following attributes in TextMetrics: fontBoundingBoxAscent, fontBoundingBoxDescent
TAG Review:
https://github.com/w3ctag/design-reviews/issues/302
Summary
This is 3nd attempt to ship TextMetrics (first attempt link, second attempt). The current canvas TextMetrics API exposes the width, actualBoundingBoxLeft, actualBoundingBoxRight, actualBoundingBoxAscent, actualBoundingBoxDescent of the measured text. Part of the new API was already implemented under a flag, but there were some inconsistencies and bugs, especially with RightToLeft text.
The original feature bug (https://crbug.com/277215) has strong user support (23 stars).
Link to “Intent to Implement” blink-dev discussion
The thread was titled “Intent to ship”, but it was seen as “Intent to implement” and was never actually shipped.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Demo link
-
Debuggability
No DevTools needed for debug. Users can console print the full TextMetrics object in one line.
Risks
Interoperability and Compatibility
Safari already has already shipped these metrics following this spec. Firefox started development 4 years ago but never shipped
Firefox: In development
Safari: Shipped
We know this is a feature requested by developers (as well as internal Google teams like Google Docs). This API will help developers have more control and more accurate text rendering. As of today a different way to achieve this is by using rendering text to the DOM and using getBoundingClientRect to get some measurements. This process requires a relayout of the page.
Activation
Enable the platform experiment ExtendedTextMetrics
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
A set of test for each metric, prefixed by “2d.text.measure”:
Entry on the feature dashboard
We know this is a feature requested by developers (as well as internal Google teams like Google Docs). This API will help developers have more control and more accurate text rendering. As of today a different way to achieve this is by using rendering text to the DOM and using getBoundingClientRect to get some measurements. This process requires a relayout of the page.
Activation
Enable the platform experiment ExtendedTextMetrics
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
A set of test for each metric, prefixed by “2d.text.measure”:
Entry on the feature dashboard
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/0a8b7cfb-e4ca-4568-b93b-5afb7efb970cn%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC3hXJerEYWXfMxHV5BC925qrNh-kdsSoydgxGeuLv8m0nrBWw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAO9a1H6_ToTFJA9VyOcqfsoX2iOqbh%3Dnno13x0TADu%2BT1_0TUQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw-xYK4zHhiPN279yStTkgLpV%2B7RqZp5YQNxZ0JnxaxHsA%40mail.gmail.com.