[PR #13549] AtlasEngine: Scale glyphs to better fit the cell size #29620

Open
opened 2026-01-31 09:35:56 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13549

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/microsoft/terminal/pull/13549 **State:** closed **Merged:** Yes --- 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 ✅
claunia added the pull-request label 2026-01-31 09:35:56 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29620