This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] Use ascent/descent rather than deprecated top/bottom for glyph bounds #35960
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gskinnerTeam/flutter-wonderous-app#11.
This change fixes both issues I described in the corresponding bug (and seems to solve other text quality problems as well!)
The bounds bug turned out to be usage of the deprecated top/bottom bounds values -- this doesn't correspond to actual pixel coverage of some glyphs (including all of the Chinese glyphs in this particular typeface). The safe way to determine the max onscreen coverage glyphs seems to be the ascend/descend values. We were also already using the baseline ascend for positioning glyphs in the scene, so this also corrects the positioning, which was off by a couple of pixels.
Additionally, for the atlas generation I switched from scaling the point value directly to scaling Skia's CTM. I don't think this changes anything in this typeface, but it's more correct and may fix problems in other typefaces we haven't seen yet.
I don't think we have typefaces with Chinese glyphs in the repo, but the existing text playgrounds continue to work/look good (and the English version of the Wondrous app seems to have fewer text artifacts).