Use the OpenType baseline table to implement textBaseline alignment and TextMetrics baseline attributes
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(2 files)
Currently, we "fake" hanging and ideographic baselines for these canvas2d APIs by just using arbitrary factors of the font ascent and descent: https://searchfox.org/mozilla-central/rev/d307d4d9f06dab6d16e963a4318e5e8ff4899141/dom/canvas/CanvasRenderingContext2D.cpp#4400-4407
For accurate results, we should read baseline positions from the font (when provided), and use those rather than these ad hoc guesses.
Assignee | ||
Comment 1•2 years ago
|
||
These tests assume a TextMetrics.getBaselines() function, which does not exist in the current spec;
rather, it has specific attributes for alphabetic, hanging and ideographic baselines.
I think the test was based on an older proposal that didn't end up in the spec in that form.
(See https://html.spec.whatwg.org/multipage/canvas.html#textmetrics)
In addition, the values the tests expect don't correspond to what's in the CanvasTest font 'BASE'
table for the hanging and ideographic baselines (they seem to be the ascent and descent instead).
So fixing those, in preparation for actually implementing support.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D181881
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a908a6cc6603
https://hg.mozilla.org/mozilla-central/rev/f27a6b03f043
Description
•