Investigate alternative ways to handle box drawing/block elements #8128

Open
opened 2026-01-31 01:21:25 +00:00 by claunia · 0 comments
Owner

Originally created by @DHowett-MSFT on GitHub (May 14, 2020).

Originally assigned to: @lhecker on GitHub.

There've been some concerns about how we scale glyphs in the Box Drawing character block.

Other terminal emulators do interesting things:

  • Gnome-terminal uses little 5x5 bitmaps and stretches them to fill the entire cell (shout-out to @egmontkob for telling me this!)
    • This results in pixel perfect lines and shading.
  • [Other popular terminal] uses line-drawing primitives at the graphics layer to mimic box drawing and rect-filling primitives with opacity to mimic block elements
    • This also results in pixel-perfect lines and cool blended shading glyphs.

We chose not to do these things for v1.0 because we learned that certain fonts (monofur is a good one) have their own unique styles for box drawing and block elements that we wanted to preserve.

Proposed solution

  • Add a setting for "Let Windows Terminal handle block / powerline drawing"
    • This is a per-profile setting. profile::compatibility.builtinBlockDrawing
    • When enabled, Terminal will manually draw box-drawing and powerline glyphs, replacing the glyph from the font
    • Enable this by default
      • Obviously, users will be able to opt out
      • This will give us the benefit of getting PL glyphs even for fonts without them!
    • We should probably start with a few of the glyphs as higher pri:
      image
      • Green: Definitely, in v0
      • Yellow: okay probably yea
      • Orange: meh
      • red: probably too expensive (engineering wise)
      • white: I can't imagine we'll actually need to draw these
  • Add a secondary setting for "Replace filled rectangles with transparent glyphs"
    • Only enable if compatibility.builtinBlockDrawing is enabled
Originally created by @DHowett-MSFT on GitHub (May 14, 2020). Originally assigned to: @lhecker on GitHub. There've been some concerns about how we scale glyphs in the [Box Drawing character block](https://www.unicode.org/charts/PDF/U2500.pdf). Other terminal emulators do interesting things: * Gnome-terminal uses little 5x5 bitmaps and stretches them to fill the entire cell (shout-out to @egmontkob for telling me this!) * This results in pixel perfect lines and shading. * [Other popular terminal] uses line-drawing primitives at the graphics layer to mimic box drawing and rect-filling primitives with opacity to mimic block elements * This also results in pixel-perfect lines _and_ cool blended shading glyphs. We chose not to do these things _for v1.0_ because we learned that certain fonts (monofur is a good one) have their own unique styles for box drawing and block elements that we wanted to preserve. ## Proposed solution * Add a setting for "Let Windows Terminal handle block / powerline drawing" * This is a per-profile setting. `profile::compatibility.builtinBlockDrawing` * When enabled, Terminal will manually draw box-drawing and powerline glyphs, _replacing the glyph from the font_ * Enable this by default * Obviously, users will be able to opt out * This will give us the benefit of getting PL glyphs even for fonts without them! * We should probably start with a few of the glyphs as higher pri: ![image](https://github.com/microsoft/terminal/assets/18356694/6c2759b9-6b20-48c3-9357-79060eef35b1) * Green: Definitely, in v0 * Yellow: okay probably yea * Orange: meh * red: probably too expensive (engineering wise) * white: I can't imagine we'll actually need to draw these * Add a secondary setting for "Replace filled rectangles with transparent glyphs" * Only enable if `compatibility.builtinBlockDrawing` is enabled ### Links * [ ] #6161 Block-drawing glyphs aren't antialiased * [ ] #3498 may affect how we choose to draw these "pixel-perfect" glyphs. * [ ] #7260
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8128