terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Our box drawing character range is too broad (was: `\u25ef` rendered too big)

Open mrbeardad opened this issue 1 year ago • 5 comments

Windows Terminal version

1.18.3181.0

Windows build number

10.0.22621.0

Other Software

lazygit v0.40.2 nerdfont v3.1.1 SauceCodePro

Steps to reproduce

\u25ef ->

Expected Behavior

render correctly when turn off atlas

image

Actual Behavior

image

mrbeardad avatar Dec 10 '23 14:12 mrbeardad

This is a two-part problem.

  1. A font authoring issue. There is no glyph in "Sauce Code Pro" for U+25EF.
  2. The engine cuts it off instead of letting it extend outside its boundary. @lhecker, Atlas Engine believes all glyphs in range U+2500 to U+25FF to be block elements, but in truth the box drawing and block elements blocks only extend from U+2500 to U+259F. The block after that is "geometric shapes".

Even if we fix 2, the circle will not look ideal since it is much bigger than a single monospaced character cell. If you want it to look right, choose a more complete font.

DHowett avatar Dec 11 '23 18:12 DHowett

Font fallback configuration could possibly also help with scenarios like this (#2664).

j4james avatar Dec 11 '23 22:12 j4james

Another question, does atlas always cut glyph off rather than scale it?

mrbeardad avatar Dec 12 '23 01:12 mrbeardad

Font fallback configuration could possibly also help with scenarios like this (#2664).

Absolutely!

Another question, does atlas always cut glyph off rather than scale it?

No. For normal glyphs (see bug 2 in https://github.com/microsoft/terminal/issues/16451#issuecomment-1850620815), Atlas always allows the glyph to extend out of bounds. It is incorrect to scale glyphs down, as we have seen with characters from non-en-US languages and italic or bold text.

DHowett avatar Dec 12 '23 01:12 DHowett

I'd like to leave this issue open to track the U+259F vs. U+25FF you mentioned, Dustin.

But that aside, I also don't personally wish to specifically address the ◯ glyph right now. Scaling glyphs down, as we've done with the old text renderer, has lead to all sorts of similarly subtle bugs over the years and I don't really want to reintroduce them. I'd rather implement customized font fallback in a future Terminal version.

lhecker avatar Dec 12 '23 18:12 lhecker

Oh right, this was fixed with #16729.

lhecker avatar Mar 28 '24 17:03 lhecker