-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AtlasEngine: Scale glyphs to better fit the cell size (#13549)
This commit contains 3 improvements for glyph rendering: * Scale block element and box drawing characters to fit the cell size "perfectly" without leaving pixel gaps between cells. * Use `IDWriteTextLayout::GetOverhangMetrics` to determine whether glyphs are outside the given layout box and if they are, offset their position to fit them back in. If that still fails to fit, we downscale them. * Always scale up glyphs that are more than 2 cells wide This ensures that long ligatures that mimic box drawing characters like "===" under Cascadia Code are upscaled just like regular box drawings. Unfortunately this results in ligature-heavy text (like Myanmar) to get an "uneven" appearance because some ligatures can suddenly appear too large. It's difficult to come up with a good heuristic here. Closes #12512 ## Validation Steps Performed * Print UTF-8-demo.txt * Block characters don't leave gaps ✅ * Print a lorem-ipsum in Myanmar * Glyphs aren't cut off anymore ✅ * Print a long "===" ligature under Cascadia Code * The ligature is as wide as the number of cells used ✅
- Loading branch information
Showing
7 changed files
with
473 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.