Consolas text above a certain size does not get right-aligned properly
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(1 file, 1 obsolete file)
I'm experimenting with Consolas as the default monospace font on Windows, and I find that layout/reftests/text/1522857-1.html fails. (It also fails if I modify the test to use Consolas instead of monospace.) It only fails, on my machine, when the font-size is at least 125px. This feels like a return of bug 1522857 but I couldn't reproduce this with various other fonts on my system.
Assignee | ||
Comment 1•5 years ago
•
|
||
So it seems like we have a similar issue here, where the CompressedGlyph
is not being marked as CHAR_IS_SPACE
. When the text run is initially created, we do correctly set that flag, under gfxShapedText::SetupClusterBoundaries
, but when we got to shape it, we overwrite the CompressedGlyph
with a new value without CHAR_IS_SPACE
. That's done by gfxHarfBuzzShaper::SetGlyphsFromRun
calling gfxShapedText::SetGlyphs
.
Assignee | ||
Comment 2•5 years ago
|
||
I think most (but not all) callers of gfxShapedText::SetGlyphs
do want to preserve the character type flags.
Assignee | ||
Comment 3•5 years ago
|
||
Maybe the CAN_BREAK_BEFORE
flags too?
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Comment 6•5 years ago
•
|
||
Here's a try push of the alternative approach I'd like to suggest.... let's see how it goes:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=40388e844f187637f22c701c25f16dd315f3ee06
Comment 7•5 years ago
|
||
Looking at gfxShapedText::SetGlyphs and how it's used by the various callers, I think we should rework it so that it doesn't touch any of the character flags, and is only responsible for setting the DetailedGlyph data for the given index. In most cases, callers don't want to touch the other flags, and currently in some cases we have go to extra effort e.g. to read the existing IsClusterStart flag only so as to pass it back again as part of the CompressedGlyph.
So I propose renaming SetGlyphs to SetDetailedGlyphs, and passing in not a CompressedGlyph record (with flags that the caller probably didn't want to deal with at all) but just a glyph count and pointer to the DetailedGlyph records. I'll post a patch for your consideration.
Comment 8•5 years ago
|
||
Comment 9•5 years ago
|
||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Comment 11•5 years ago
•
|
||
Backed out changeset 3c88adc13a06 for causing assertion failures regarding glyphs.
Backout link: https://hg.mozilla.org/integration/autoland/rev/c218ff4e2a2c50b6b76a4372672e3aa0df7ce093
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=311488771&repo=autoland&lineNumber=28669
Comment 12•5 years ago
|
||
Ahh... reftests managed to find a case where I tripped over my own assertion; well, that's what it's there for! Now fixed.
Comment 13•5 years ago
|
||
![]() |
||
Comment 14•5 years ago
|
||
bugherder |
Description
•