Expose glyph emHeights in TextMetrics
Categories
(Core :: Graphics: Canvas2D, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox118 | --- | fixed |
People
(Reporter: twisniewski, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(5 files)
Chrome implementation bug: https://bugs.chromium.org/p/chromium/issues/detail?id=277215
Supporting this would let us pass these interop2023 WPTs:
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
We have support for this behind a pref, but last I checked, there was some lack of clarity about exactly what the values should be. We should look into that again, and see if there's a solid enough spec to move forward, or potentially push back against this being part of interop-2023 if the spec isn't ready.
Assignee | ||
Comment 2•2 years ago
|
||
Without the explicit USE_TYPO_METRICS flag, it's unclear whether metrics should be derived
from the font's 'OS/2' table's sTypo* fields, its usWin* fields, or the separate 'hhea' table,
and the values are quite different. (And legacy behavior varies among applications/platforms.)
Setting this flag is recommended by the OpenType spec to provide an unambiguous signal that
the OS/2 "typographical metrics" fields should be used, and so improves the chance of
getting reliably interoperable results.
Note that this means the fontBoundingBox test expectations need to be updated to reflect
the use of the sTypo* metrics fields to determine ascent/descent.
https://learn.microsoft.com/en-gb/typography/opentype/spec/os2#fsselection
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
The CanvasTest font's metrics indicate that its ascent is 75% of the em-size, and descent is 25%.
But using a font-size of 50px means these will be fractional-pixel dimensions, which introduces
the possibility of rounding resulting in minor discrepancies.
Changing the font-size to 40px allows the resulting ascent and descent to be integer values that
can more reliably be tested/compared.
Depends on D184605
Assignee | ||
Comment 4•2 years ago
|
||
Trying to enable this, I noticed that we're returning it with the wrong sign;
it's expected to be measured positive-downwards.
Depends on D184606
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D184607
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D184608
Assignee | ||
Comment 7•2 years ago
|
||
Note that patch 1 here modifies the existing CanvasTest font, and affects other tests that use it. I've opened https://github.com/web-platform-tests/interop/issues/386 about this change.
Comment 9•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/81d8c94a76f7
https://hg.mozilla.org/mozilla-central/rev/4f1878e8cb86
https://hg.mozilla.org/mozilla-central/rev/110166695d5e
https://hg.mozilla.org/mozilla-central/rev/b61d00e3d775
https://hg.mozilla.org/mozilla-central/rev/90b19e0d07e5
Comment 11•2 years ago
|
||
The browser compat data for this needs to be updated. So adding the dev-doc-needed
flag.
Sebastian
Updated•2 years ago
|
Updated•2 years ago
|
Comment 14•2 years ago
|
||
FF118 Docs work for this done/tracked in https://github.com/mdn/content/issues/28852
Description
•