Skip to content

Heavy symbols (e.g. heavy check mark) appear squashed in Consolas font #892

Closed

Description

@jaynavar

I've noticed that heavy symbols like heavy check mark (U+2714) or heavy greek cross (U+271A) appear squashed in mintty when using the Consolas font. I've attempted to use secondary fonts to have it fallback to Monaco (which I have installed) since it seems like it supports those characters, but it doesn't appear to be working. I set Font1=Consolas and Font2=Monaco, but it just defaulted to Lucida Console when I did that, and setting Font=Consolas and Font2=Monaco just applied regular Consolas.

How can I get these heavy symbols to display properly while still using the Consolas font for regular characters?

Here is what the regular symbols look like:
image

Here is what the heavy symbols look like:
image

Activity

  1. BrianInglis commented on Jul 16, 2019

    @BrianInglis

    Depending on your localization MS sometimes define linked fonts used as fallbacks.
    You may also define your own linked fonts to use as fallbacks.
    Check which fonts on your system have linked fonts as fallbacks.
    See https://docs.microsoft.com/en-us/globalization/input/font-technology#font-linking

  2. BrianInglis commented on Jul 16, 2019

    @BrianInglis

    Assuming you have Cygwin installed, possibly the easiest way to list font links is:

    $ regtool -lv list /HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows\ NT/CurrentVersion/FontLink/SystemLink
    

    FontLink_SystemLink.reg.txt

  3. mintty commented on Jul 16, 2019

    @mintty
    Owner

    The affected symbols appear to be wider than a single character cell. This often leads to clipped character rendering which is of course not good in general. Therefore mintty has some heuristics that detect glyphs that are too wide and displays them narrowed.

    About secondary fonts, these would additionally have to be activated with option FontChoice. However, the feature is only supported per "script" (like Latin, Greek, Cyrillic), not per arbitrary Unicode range (the characters are in the Dingbats range).

  4. mintty commented on Jul 16, 2019

    @mintty
    Owner

    I could not reproduce the narrowed appearance with Consolas, what's your font size and screen resolution?
    If the resulting rendering is not considered appreciable, by 2 or 3 commenting people, we can talk about an option to disable narrowing, or extending the secondary font option to other ranges, or both...

  5. mintty commented on Jul 16, 2019

    @mintty
    Owner

    If you want to check out how your example looks like without narrowing, you could uncomment line 2059 in file term.c:
    //tattr.attr |= ATTR_NARROW;

  6. jaynavar commented on Jul 16, 2019

    @jaynavar
    Author

    I'm using font size 12. Screen resolution is 1920x1080.

    Isn't dingbats in the Zyyy script? Shouldn't something like this have worked (it doesn't)?:

    FontChoice=Zyyy:2
    Font2=Monaco
    
  7. mintty commented on Jul 16, 2019

    @mintty
    Owner

    Sorry, I didn't mean to ask the screen size but its density / DPI / "scaling" factor (like 100%/125%/150% in Windows).
    No, Dingbats is not in a script range. Unicode "scripts" refer to language-specific character sets; Latin is a script, Han, Hebrew or Arabic.

  8. jaynavar commented on Jul 16, 2019

    @jaynavar
    Author

    The scaling factor is 100%.

  9. jaynavar commented on Jul 16, 2019

    @jaynavar
    Author

    @BrianInglis I tried adding font linking for Consolas (setting Monaco as the first linked font), and restarted my PC but it didn't fix the issue.

  10. mintty commented on Jul 17, 2019

    @mintty
    Owner

    This time I can reproduce it at least with one of the sample characters, ❐.
    It is rendered wide in mintty 3.0.1. However, the resulting glyph is considerably wider than a character cell; verify this with echo -e '\u2750x'. The assumedly better appearance in the prompt status line is only due to the fact that they are followed by space there. So this was actually a bug, which mintty 3.0.2 fixed as listed in the change log:

    • Check functions (width, glyph) consult proper attributes and font.

    So this is a design issue. Proposals are welcome, e.g.:

    • An option to disable auto-narrowing. At the cost of overlapping such characters with subsequent glyphs, obviously.
    • Auto-magic to detect whether a wide glyph is followed by white space and not narrow it in that case.
    • ...?
  11. jaynavar commented on Jul 18, 2019

    @jaynavar
    Author

    Both of those suggestions sound good to me, although the latter won't solve my issue as in one of the places it's used in Git Bash Prompt it is not followed by a space.

    That being said, I'm not seeing it take up more space than a single character, so not sure why it would need to be clipped by the current glyph-magic. See these screenshots from Consolas 12pt with v3.0.1:

    image
    image

    For now reverting to 3.0.1 fixed the issue for me, thanks @murthyl for the tip!

  12. mintty commented on Jul 18, 2019

    @mintty
    Owner

    I'm not seeing it take up more space than a single character

    You can see it in @murthyl's second screenshot above. It may vary by character but also with font size and DPI mapping, and maybe also with the font version.
    About the prompt, I see a space after every symbol @murthyl's screenshot. If you have another prompt, please send a screen log (or prompt definition).

  13. mintty commented on Jul 18, 2019

    @mintty
    Owner

    Note that the latter two characters, U+2705 and U+26A1, have the Unicode Wide property (as defined in EastAsianWidth.txt), so lxterminal is actually wrong about them. They are also emojis. With configuration Emojis=emojione, I get the following appearance (Consolas 14pt, 100% screen) which looks OK for me:
    narrow-wide

  14. 17 remaining items

  15. JDNdeveloper commented on Sep 2, 2019

    @JDNdeveloper

    The current rendering is not ideal for me. I'll stick with 3.0.1 if the current behavior in 3.0.2 onwards is considered "works as designed". Feel free to close the issue if no further work is planned for this.

  16. mintty commented on Sep 2, 2019

    @mintty
    Owner

    Considering the options that were discussed before, you are welcome to make a design proposal.

  17. JDNdeveloper commented on Sep 2, 2019

    @JDNdeveloper

    Would it be possible to add a setting to go back to the pre-3.0.2 auto-narrowing behavior for certain unicode blocks like dingbats? I understand that this was fixing an existing bug, however as it seems non-trivial to find a generic "proper" fix for this it would be a surefire way to solve the problem for those of us affected by it.

  18. mintty commented on Sep 2, 2019

    @mintty
    Owner

    A better solution would be to adjust the scaling from 0.5 to 0.7 or 0.8, maybe configurable if it must,
    and maybe even dynamically adapated to the respective glyph width (expect some performance penalty maybe).

  19. JDNdeveloper commented on Sep 3, 2019

    @JDNdeveloper

    A configurable scaling for certain characters/blocks seems like a good solution. I'm worried about dynamic widths as it doesn't seem to be consistent across devices.

  20. BrianInglis commented on Sep 4, 2019

    @BrianInglis

    Normally if you want to ensure a particular appearance of certain glyphs, you pick a font whose characteristics match those you consider important e.g. I chose DejaVu Sans Mono for my systems, browsers, editors, terminals, to ensure that I could easily distinguish between digits, letters, and punctuation which look more similar in other fonts at smaller sizes.

    I think selection of an appropriate (perhaps heavy weight) font is a better approach to ensuring that you get sufficiently heavy HEAVY symbols, rather than adding more mintty options and tweaks for a very narrow requirement, which may have unfortunate effects on the fonts used by the majority of the user base, and increased chances of issues and overheads for everyone.

    If those glyphs are holes in other fonts you prefer for other purposes, you may configure the fonts with the heavy symbols as fallbacks for the fonts which do not supply those symbols, using Windows font linking, or fontconfig font fallback.

    There are a good number of open source and free fonts from various sources: GNU, Google, SIL, and many other sites, with characteristics matching just about any requirement, and I have never failed to find one which matches specific needs, perhaps with some additional effort required.

    Cygwin also has a great selection packaged for easy installation, which you can just drag and drop into /Windows/Fonts/ after install, as I don't believe mintty can use fontconfig fonts:

    adobe-source-code-pro-fonts 1.017-2 noarch
    adobe-source-sans-pro-fonts 1.050-2 noarch
    adobe-source-serif-pro-fonts 1.017-1 noarch
    alef-fonts 1.0-2 noarch
    arimo-fonts 20171024-1.git8ef14e6 noarch
    artwiz-aleczapka-fonts 1.3-2 noarch
    bitstream-vera-fonts 1.10-2 noarch
    caladea-fonts 20130214-1 noarch
    cantarell-fonts 0.0.25-1 noarch
    carlito-fonts 20130920-1 noarch
    cousine-fonts 20171024-1.git8ef14e6 noarch
    culmus-fonts 0.131-1 noarch
    dejavu-fonts 2.37-1 noarch
    fontawesome-fonts 4.7.0-1 noarch
    ghostscript-fonts-other 6.0-1 noarch
    ghostscript-fonts-std 20170801-5 noarch
    gnu-free-fonts 20120503-2 noarch
    inconsolata-fonts 1.010-1 noarch
    kanjistrokeorders-fonts 3.001-1 noarch
    liberation-fonts 1.07.4-1 noarch
    linux-libertine-fonts 5.3.0-1 noarch
    lohit-*-fonts 2.91.2-1 noarch
    noto-*-fonts 20171024-1.git8ef14e6 noarch
    overpass-fonts 3.0-1 noarch
    oxygen-fonts 5.4.3-1 noarch
    sj-fonts 2.0.2-2 noarch
    symbola-fonts 9.00-1 noarch
    terminus-fonts 4.40-1 noarch
    texlive-collection-fontsextra 20190509-1 noarch
    texlive-collection-fontsrecommended 20190509-1 noarch
    tinos-fonts 20171024-1.git8ef14e6 noarch
    unifont-fonts 8.0.01-1 x86_64
    urw-base35-fonts 20170801-5 noarch
    urw-base35-fonts-legacy 20170801-5 noarch
    xorg-x11-fonts-ethiopic 7.5-3 noarch
    
  21. JDNdeveloper commented on Sep 4, 2019

    @JDNdeveloper

    I prefer to use the Consolas font and don't feel that I should have to change my font in order to avoid squashed symbols. I don't have a particular need for the heavy checkmark to be extremely heavy, I just don't want it to be squashed. I have already tried font fallbacks but it didn't solve the issue.

    If there is no solution to this problem without causing negative side effects for others I am happy to stick with 3.0.1, however as @mintty has continued to work on this (thank you!) I feel we'll be able to come up with a solution that works for everyone.

  22. JDNdeveloper commented on Sep 6, 2019

    @JDNdeveloper

    I've set CharNarrowing=100 and it's rendering the glyphs perfectly! Thank you @mintty!

  23. jaynavar commented on Sep 24, 2019

    @jaynavar
    Author

    I just wanted to follow up. I recently installed some new Cygwin packages (not sure the full list due to dependencies), and one of them seems to have messed with the rendering. I'm now seeing the "glyph overlap" that was previously described, and that I had never seen before. Using CharNarrowing=100 shows the glyph as clipped now. Setting to CharNarrowing=50 looks better, but still not fully correct. Really not sure what package could be causing this issue.

  24. mintty commented on Sep 26, 2019

    @mintty
    Owner

    Released 3.0.3.

  25. mintty commented on Sep 3, 2021

    @mintty
    Owner

    Released 3.5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions