CanvasRenderingContext2D.measureText() does not fill actualBoundingBox properties for emoji
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: mitya57, Unassigned)
Details
Attachments
(1 file)
587 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0
Steps to reproduce:
Please see the attached test case. It creates a canvas 2D context and tries to measure dimensions of various characters. For characters that are not emoji, actualBoundingBox{Left,Right,Ascent,Descent} properties are properly set. For emojis, they are all zero.
But the canvas itself can draw these emojis properly, which is also demonstrated.
My environment is: Debian GNU/Linux unstable amd64, with Noto Color Emoji font installed, Firefox 86.0.
Actual results:
Output in console:
A
TextMetrics { width: 34.20000076293945, actualBoundingBoxLeft: 0, actualBoundingBoxRight: 34, actualBoundingBoxAscent: 36, actualBoundingBoxDescent: 0 }
☺
TextMetrics { width: 52.119998931884766, actualBoundingBoxLeft: -4, actualBoundingBoxRight: 48, actualBoundingBoxAscent: 41, actualBoundingBoxDescent: 4 }
😀
TextMetrics { width: 50, actualBoundingBoxLeft: 0, actualBoundingBoxRight: 0, actualBoundingBoxAscent: -0, actualBoundingBoxDescent: 0 }
🦏
TextMetrics { width: 50, actualBoundingBoxLeft: 0, actualBoundingBoxRight: 0, actualBoundingBoxAscent: -0, actualBoundingBoxDescent: 0 }
Expected results:
Output of the same page in Chromium 88:
A
TextMetrics {width: 33.349609375, actualBoundingBoxLeft: 0, actualBoundingBoxRight: 34, fontBoundingBoxAscent: 45, fontBoundingBoxDescent: 11, …}
☺
TextMetrics {width: 51.0498046875, actualBoundingBoxLeft: -10, actualBoundingBoxRight: 41, fontBoundingBoxAscent: 45, fontBoundingBoxDescent: 11, …}
😀
TextMetrics {width: 62.390625, actualBoundingBoxLeft: 0, actualBoundingBoxRight: 63, fontBoundingBoxAscent: 45, fontBoundingBoxDescent: 11, …}
🦏
TextMetrics {width: 62.390625, actualBoundingBoxLeft: 0, actualBoundingBoxRight: 63, fontBoundingBoxAscent: 45, fontBoundingBoxDescent: 11, …}
Comment 1•4 years ago
|
||
Duplicate of bug 1692791 perhaps?
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Canvas: 2D' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Reporter | ||
Comment 3•4 years ago
|
||
Oh, yes, it looks very similar! Marking as duplicate.
Description
•