Mintty: Use a fallback font to display missing characters

Created on 5 Aug 2016  路  13Comments  路  Source: mintty/mintty

My shell prompt displays a hourglass character to indicate background jobs. This character is displayed as a rectangular block in mintty:
image

Gnome terminal displays the character properly:
image

This is how I print this character. I'm using fish shell, but the problem is present on bash as well.
I tried various fonts, but the problem seems to be unaffected by this.

What else could I try to fix the problem?

Most helpful comment

Released Uniscribe support in 2.7.1.
This does not solve all potential font fallback cases, though.

All 13 comments

I'm using cygwin but on its side everything looks good:

~ > printf '\u231b' | hexdump
0000000 8ce2 009b
0000003

The rectangular block indicates that the character is not available in the font being used. This is not a bug as such. However, the character is displayed also, e.g., in notepad, configured to the same font as mintty. The only explanation that comes to my mind is that different "font fall-back" mechanisms of Windows are used. I don't know how this could be changed. Maybe it's not possible with the current output API (ExtTextOut).

Yes, looks like notepad goes through available fonts to find one with the missing character. It would be nice if mintty could do that. Thanks for help anyway :smile:

Windows Font Linking can be configured in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink
If you add an entry for your preferred mintty text font, it might work.
Maybe something similar can be achieved by Windows API calls, so mintty could establish some reasonable default behaviour. Suggestions welcome.

Font linking does help, thank you!

Good that you could configure a personal workaround.
However, as a generic improvement, this approach is not suitable for mintty.
See my comment in #605.

@mintty Latest SciTE supports font fallback and also ligatures:

SciTE

Thanks, I see in the code it uses ExtTextOutW like mintty; if you can identify where/how it handles font fallback and ligatures, I will take a closer look.

Released Uniscribe support in 2.7.1.
This does not solve all potential font fallback cases, though.

thank you!

@mintty Amazing work!

Released 2.7.5 with default FontRender=uniscribe.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pexcn picture pexcn  路  5Comments

fengyichui picture fengyichui  路  4Comments

fengyichui picture fengyichui  路  5Comments

avoidik picture avoidik  路  12Comments

Trismegistos84 picture Trismegistos84  路  13Comments