[PR #16729] Add support for custom box drawing and powerline glyphs #30984

Closed
opened 2026-01-31 09:44:20 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


This adds support for drawing our own box drawing, block element,
and basic Powerline (U+E0Bx) glyphs in AtlasEngine.

This PR consists of 4 parts:

  • AtlasEngine was refactored to simplify _drawGlyph because I've
    wanted to do that for ~1 year now and never got a chance.
    Well, now I'm doing it and you all will review it muahahaha.
    The good news is that it removes a goto usage that even for my
    standards was rather dangerous. Now it's gone and the risk with it.
  • AtlasEngine was further refactored to properly parse out text that
    we want to handle different from regular text. Previously, we only
    did that for soft fonts, but now we want to do that for a lot more,
    so a refactor was in order. The new code is still extremely
    disgusting, because I now stuff wchar_ts into an array that's
    intended for glyph indices, but that's the best way to make it fast
    and not blow up the complexity of the code even further.
  • Finally this adds a huge LUT for all the aforementioned glyphs.
    The LUT has 4 "drawing instruction" entries per glyph which describe
    the shape (rectangle, circle, lines, etc.) and the start/end coord.
    With a lot of bit packing each entry is only 4 bytes large.
  • Finally-finally a builtinGlyphs setting was added to the font
    object and it defaults to true.

Closes #5897

Validation Steps Performed

  • RenderingTests with soft fonts
  • All the aforementioned glyphs
  • ...with color
  • customGlyphs setting can be toggled on and off
**Original Pull Request:** https://github.com/microsoft/terminal/pull/16729 **State:** closed **Merged:** Yes --- This adds support for drawing our own box drawing, block element, and basic Powerline (U+E0Bx) glyphs in AtlasEngine. This PR consists of 4 parts: * AtlasEngine was refactored to simplify `_drawGlyph` because I've wanted to do that for ~1 year now and never got a chance. Well, now I'm doing it and you all will review it muahahaha. The good news is that it removes a goto usage that even for my standards was rather dangerous. Now it's gone and the risk with it. * AtlasEngine was further refactored to properly parse out text that we want to handle different from regular text. Previously, we only did that for soft fonts, but now we want to do that for a lot more, so a refactor was in order. The new code is still extremely disgusting, because I now stuff `wchar_t`s into an array that's intended for glyph indices, but that's the best way to make it fast and not blow up the complexity of the code even further. * Finally this adds a huge LUT for all the aforementioned glyphs. The LUT has 4 "drawing instruction" entries per glyph which describe the shape (rectangle, circle, lines, etc.) and the start/end coord. With a lot of bit packing each entry is only 4 bytes large. * Finally-finally a `builtinGlyphs` setting was added to the font object and it defaults to `true`. Closes #5897 ## Validation Steps Performed * RenderingTests with soft fonts ✅ * All the aforementioned glyphs ✅ * ...with color ✅ * `customGlyphs` setting can be toggled on and off ✅
claunia added the pull-request label 2026-01-31 09:44:20 +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#30984