Terminal: Incorrect Font Fallback Behavior (we fall back to Segoe UI sometimes!)

Created on 7 Jan 2020  ยท  7Comments  ยท  Source: microsoft/terminal

_notes from @DHowett_ - we're also falling back to Segoe UI Symbol when box-drawing glyphs don't exist. We should have a smart internal font fallback table that we consult _even when we allow customization in #2664._

Environment

Microsoft Windows [Version 10.0.18362.535]
Windows Terminal version (if applicable): 0.7.3451.0

Steps to reproduce

Print anything in Hebrew when using a font without Hebrew glyphs (e.g. Cascadia Code or Consolas).

image

Expected behavior

So, leaving aside RTL being tough, there's a very specific error here. Namely, font fallback in the code seems to be:
Consolas --> Lucida Console --> Courier New.
This should fail the first two, but the Hebrew charset is covered in Courier New, so that should be the font used here. If you set the font to Courier New, you can see that the font rendering itself is not messed up. Still RTL is tough, but -- the ransom note aspect of it is gone.

image

Actual behavior

With the benefit of super zooming in, it seems to me that the font being used for Hebrew is Segoe UI. I assume that it's some sort of system default, MSFT and whatnot, but that's really not good. Courier New may be jarring, as you'd expect from fallback, but given that it's at least monospaced I assume that the ransom note aspect of the text rendering here wouldn't happen. Segoe UI is not monospaced, and I think that's why you get the ransom note like variation in text sizes.

An important clarification / note: this is _NOT_ a regression. This is not a new bug, it's been around forever. The only new thing is that I read the source code yesterday and realized that it wasn't supposed to happen.

Area-Rendering Issue-Bug Priority-2 Product-Terminal

All 7 comments

We're probably going to resolve this one when we knock it out with /dup #2664. The fallback list we're using isn't actually for looking up characters, if I recall properly-- it's what we use when the user's provided font just doesn't exist.

Thanks for the report!

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

You know, I've changed my mind and would rather treat this as a separate rendering bug. We should try to make sure the default fallback set is as robust as we can before giving users the ability to configure one of their own. We may even want to go so far as to make sure their fallback set is applied _on top_ of ours.

Basic Comparison table of glyph & alphabet support for the grab bag of fonts I have on my computer

Font                     Glyph Count  Greek    Cyrillic    Armenian    Hebrew    Arabic
---------------------  -------------  -------  ----------  ----------  --------  --------
Cascadia Code Regular           1624  โœ…       โœ…          โŒ          โŒ        โŒ
Cascadia Mono Regular           1624  โœ…       โœ…          โŒ          โŒ        โŒ
Consolas                        3030  โœ…       โœ…          โœ…          โŒ        โŒ
Courier New                     3763  โœ…       โœ…          โœ…          โœ…        โœ…
Cousine                         2385  โœ…       โœ…          โŒ          โœ…        โŒ
Fira Code Regular               1638  โœ…       โœ…          โŒ          โŒ        โŒ
Kawkab Mono                     1852  โœ…       โœ…          โŒ          โŒ        โœ…
Liberation Mono                 2392  โœ…       โœ…          โŒ          โœ…        โŒ
Lucida Console                   667  โœ…       โœ…          โŒ          โŒ        โŒ
Monaco                          1104  โŒ       โœ…          โŒ          โŒ        โŒ
Noto Mono                        897  โœ…       โœ…          โŒ          โŒ        โŒ
SF Mono Regular                 1442  โœ…       โœ…          โŒ          โŒ        โŒ
Source Code Pro                 1585  โœ…       โœ…          โŒ          โŒ        โŒ
Ubuntu Mono                     1296  โœ…       โœ…          โŒ          โŒ        โŒ
* Arial                         4503  โœ…       โœ…          โœ…          โœ…        โœ…
* Segoe UI                      5344  โœ…       โœ…          โœ…          โœ…        โœ…
* Times New Roman               4685  โœ…       โœ…          โœ…          โœ…        โœ…

I would suggest probably Consolas --> Courier New as the basic fallback order?

Segoe UI doesnt have unicode block symbols. And those are often the missing symbols required to be found.

@michael-angelozzi great point. Coverage table with:

Font                     Glyph Count  Greek    Cyrillic    Armenian    Hebrew    Arabic    Box Drawing    Block Elements
---------------------  -------------  -------  ----------  ----------  --------  --------  -------------  ----------------
Cascadia Code Regular           1624  โœ…       โœ…          โŒ          โŒ        โŒ        โœ…             โœ…
Cascadia Mono Regular           1624  โœ…       โœ…          โŒ          โŒ        โŒ        โœ…             โœ…
Consolas                        3030  โœ…       โœ…          โœ…          โŒ        โŒ        โœ…             โŒ
Courier New                     3763  โœ…       โœ…          โœ…          โœ…        โœ…        โŒ             โŒ
Cousine                         2385  โœ…       โœ…          โŒ          โœ…        โŒ        โŒ             โŒ
Fira Code Regular               1638  โœ…       โœ…          โŒ          โŒ        โŒ        โŒ             โŒ
Kawkab Mono                     1852  โœ…       โœ…          โŒ          โŒ        โœ…        โœ…             โŒ
Liberation Mono                 2392  โœ…       โœ…          โŒ          โœ…        โŒ        โŒ             โŒ
Lucida Console                   667  โœ…       โœ…          โŒ          โŒ        โŒ        โŒ             โŒ
Monaco                          1104  โŒ       โœ…          โŒ          โŒ        โŒ        โŒ             โŒ
Noto Mono                        897  โœ…       โœ…          โŒ          โŒ        โŒ        โŒ             โŒ
SF Mono Regular                 1442  โœ…       โœ…          โŒ          โŒ        โŒ        โœ…             โŒ
Source Code Pro                 1585  โœ…       โœ…          โŒ          โŒ        โŒ        โœ…             โŒ
Ubuntu Mono                     1296  โœ…       โœ…          โŒ          โŒ        โŒ        โŒ             โŒ
* Arial                         4503  โœ…       โœ…          โœ…          โœ…        โœ…        โŒ             โŒ
* Segoe UI                      5344  โœ…       โœ…          โœ…          โœ…        โœ…        โŒ             โŒ
* Times New Roman               4685  โœ…       โœ…          โœ…          โœ…        โœ…        โŒ             โŒ
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdtauk picture mdtauk  ยท  3Comments

warpdesign picture warpdesign  ยท  3Comments

mrmlnc picture mrmlnc  ยท  3Comments

NickITGuy picture NickITGuy  ยท  3Comments

ghvanderweg picture ghvanderweg  ยท  3Comments