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: actualBoundingBoxLeft, actualBoundingBoxRight, fontBoundingBoxAscent, fontBoundingBoxDescent, actualBoundingBoxAscent, actualBoundingBoxDescent, emHeightAscent and emHeightDescent.
Summary
this is 2nd attempt to ship TextMetrics (first attempt link). The current canvas TextMetrics API only exposes the width 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 feature bug (https://crbug.com/277215) has strong user support (24 stars, 3 more stars since Sept 2018).
Link to “Intent to Implement” blink-dev discussion
The thread was titled “Intend to ship”, but it was seen as “Intend 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 major 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”:
https://wpt.fyi/results/2dcontext/drawing-text-to-the-canvas
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/CAC3hXJcjN0i2%3Dp3aCfXEOQgS_Btwu%3D6nJZU%2BBfVDHVptEmz_ag%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
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/CAC3hXJe2F3p0w9pv3UdUnKmU514UW%3DFfv2KOtoHoopZMHN6ChA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAO9a1H54hKZzRKnHpUkq7g4N_uvyk%2B4ttKCoeSbipHg7mdY_yg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T8NWNdB2LrkSqo7eMZfznBobW%3D%3D8UmpUUd4LWF2J-zrrA%40mail.gmail.com.
I am updating the intent to ship to match what we want to release now:
Spec
https://html.spec.whatwg.org/multipage/canvas.html#textmetrics
we are launching the following attributes in TextMetrics: actualBoundingBoxLeft, actualBoundingBoxRight, actualBoundingBoxAscent, actualBoundingBoxDescent.
Summary
this is 2nd attempt to ship TextMetrics (first attempt link). The current canvas TextMetrics API only exposes the width 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 feature bug (https://crbug.com/277215) has strong user support (25 stars, 4 more stars since Sept 2018).
Link to “Intent to Implement” blink-dev discussion
The thread was titled “Intend to ship”, but it was seen as “Intend 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
We know this is a major 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”:
https://wpt.fyi/results/2dcontext/drawing-text-to-the-canvas (canvas)
https://wpt.fyi/results/offscreen-canvas/text (offscreen canvas)
Entry on the feature dashboard
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAO9a1H6c9Xc_8wfHaT4V6-fPNgEebeLNeOWWkMWbKqnwQKOjhw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw_HXd6-s%3DGHya%3DqdBZpw%3DYEfCGCm2H_jYypuSDxhyKyFg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/op.z4r4vzb6rbppqq%40cicero2.linkoping.osa.