Closed Bug 1695494 Opened 4 years ago Closed 4 years ago

CanvasRenderingContext2D.measureText() does not fill actualBoundingBox properties for emoji

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 86
defect

Tracking

()

RESOLVED DUPLICATE of bug 1692791

People

(Reporter: mitya57, Unassigned)

Details

Attachments

(1 file)

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, …}

Duplicate of bug 1692791 perhaps?

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.

Component: Untriaged → Canvas: 2D
Product: Firefox → Core

Oh, yes, it looks very similar! Marking as duplicate.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: