Unicode box-drawing characters rendering incorrectly unless Menlo font?

14 views
Skip to first unread message

Dan Davison

unread,
May 29, 2020, 10:04:45 AM5/29/20
to iterm2-...@googlegroups.com
Can anyone help me understand under what circumstances the vertical sections of unicode box-drawing characters will "meet up", i.e. forming a continuous line rather than leaving gaps between them?

The problem affects me in iTerm2 but I do not think this is an iTerm2 bug (see below).  I was hoping someone here might nevertheless point me in the right direction (I hope that's OK.)  Have I changed some system-wide font/display/accessibility setting that I don't know about?

Here's my test example: This should produce the letter x, surrounded by a box:

printf "─┐\nx│\n─┘\n"

If those characters don't make it through the email correctly, I believe that's equivalent to

printf "\xe2\x94\x80\xe2\x94\x90\x0a\x78\xe2\x94\x82\x0a\xe2\x94\x80\xe2\x94\x98\x0a"

(My examples are all 12pt Regular and I'm keeping the "v/i" and "n/n" numbers at 100 in the iTerm2 font selection interface.) 

With Monaco font I see this:

image.png
It looks like the vertical sections of the two corner characters, and the vertical bar, are not long enough to "meet up".

In fact, I see that gap with all fonts I've tried, except Menlo seems not to do it:

image.png

With Andale Mono, the gaps are present but barely visible:

image.png

Here's why this isn't an iTerm2 bug:

I am unable to reproduce it in iTerm2 on someone else's machine: this is with Monaco on their machine

image.png

Both iTerm2 builds are the same (3.3.6 but I've also tried 3.3.10). Furthermore, I see the same incorrect rendering with other applications (Terminal.app, Cocoa Emacs), unless they are set to Menlo font. I also believe that this was working fine for me until recently, but haven't been able to think what changed.

Thanks in advance,

Dan




Richard Mitchell

unread,
May 29, 2020, 10:41:40 AM5/29/20
to iterm2-discuss
When I use <CMD>+ and <CMD>- to increase/decrease the font size, I notice it typically takes 2 hits to get the same font, just larger.  One hit seems to affect the width, and the other the height. (or maybe it is the other way around).

...this may have nothing to do with your issue, but something to try.

Dan

unread,
May 29, 2020, 4:12:30 PM5/29/20
to iterm2-discuss
Thanks -- that's not it unfortunately.

Aaron Meurer

unread,
May 29, 2020, 4:45:11 PM5/29/20
to iterm2-...@googlegroups.com
A possible issue is that the fonts you mention don't actually have all those characters, so it is substituting them from other fonts. If the characters come from two different fonts they are unlikely to line up properly as fonts will only line up characters with other characters from the same font.

Unfortunately, analysing font substitution is difficult. If anyone knows how to do it, let me know. There was a program called FontRevealer that used to do it, but it no longer works in Catalina. https://apple.stackexchange.com/questions/380000/how-to-analyze-font-substitution-in-catalina

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iterm2-discuss/083160f1-1d5c-4566-af80-87d6f84bac1e%40googlegroups.com.

George Nachman

unread,
May 29, 2020, 6:22:22 PM5/29/20
to iterm2-...@googlegroups.com
They should always match up perfectly unless you change this to YES:

image.png

Dan

unread,
May 29, 2020, 6:31:32 PM5/29/20
to iterm2-discuss
That was it! Thanks very much George. I bet I changed that when I was investigating a different box-drawing character issue and forgot I'd done it.

(In hindsight I should have searched for "box-drawing" in the advanced settings, or looked into my plists. I think I got misled by the fact that it was affecting other apps but I guess the answer is that, yes, it does not work well in other apps for Monaco at least, but iTerm2 has a fix for it.)
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages