Skip to content

Unicode glyph width handling #922

Closed
Closed

Description

@scandum

[DIR N ] [ 56] [ \u2191 ] [ ↑ ] [DIR NE ] [ 57] [ \u2B08 ] [ ⬈ ] [DIR E ] [ 58] [ \u2B95 ] [ ⮕ ] [DIR SE ] [ 59] [ \u2b0A ] [ ⬊ ] [DIR S ] [ 60] [ \u2193 ] [ ↓ ] [DIR SW ] [ 61] [ \u2B0B ] [ ⬋ ] [DIR W ] [ 62] [ \u2B05 ] [ ⬅ ] [DIR NW ] [ 63] [ \u2B09 ] [ ⬉ ]

The drawing of several unicode characters is rather poor in mintty. Especially the west pointing arrow looks more like a blurred dash than an actual arrow. You'll have to paste the above into mintty to see for yourself.

It seems to be more than just a font issue as the arrows display nicely in wordpad. Anything that can be done to improve the situation?

Activity

  1. mintty commented on Oct 3, 2019

    @mintty
    Owner

    This is, not just but, a font issue, and possibly a font fallback issue.
    You should at least mention your configured font (and size) for such an issue, and maybe a screenshot.

  2. scandum commented on Oct 3, 2019

    @scandum
    Author

    Courier New, 12.
    image

    Left pointing arrow is squished. I've also noticed some double width characters showing as single width, but haven't kept track of the codes.

  3. mintty commented on Oct 3, 2019

    @mintty
    Owner

    Please use setting CharNarrowing=100 to compensate.

  4. BrianInglis commented on Oct 3, 2019

    @BrianInglis

    This is, not just but, a font issue, and possibly a font fallback issue.

    The left black arrow is not a glyph in most fonts, although the right black arrow is, and renders anywhere from well to badly.
    Both glyphs exist and render well in Inconsolata, okay in Deja Vu Sans Mono and Fira Mono, but not well in those fonts in mintty 3.0.2 vanilla with no rendering tweaks.
    ⬅ U+02B05 LEFTWARDS BLACK ARROW
    ⮕ U+02B95 RIGHTWARDS BLACK ARROW

  5. BrianInglis commented on Oct 3, 2019

    @BrianInglis

    Does CharNarrowing=100 work only on mintty later than 3.0.2?

  6. mintty commented on Oct 3, 2019

    @mintty
    Owner

    Yes.

  7. scandum commented on Oct 3, 2019

    @scandum
    Author

    Thanks, that makes a difference in Courier New.

    With CharNarrowing set to 100 the tip of the east pointing arrow gets cut off in Consolas, but CharNarrowing=75 appears to strike a decent balance.

  8. mintty commented on Oct 4, 2019

    @mintty
    Owner

    That's not so far from the current default, 70; maybe I'll tweak that to 80.
    Also, I plan to exclude the character ranges U+2190 .. U+2BFF and U+1F000 .. U+1FAFF from auto-narrowing.

  9. BrianInglis commented on Oct 4, 2019

    @BrianInglis

    For safety, should CharNarrowing not apply only to double and ambiguous width characters, and/or those with similar attributes that render outside the character cell?
    That is, specify only a known inclusive range to do this, or possibly check glyph size in those ranges, or require users to specify other ranges to which it should apply.
    If you apply this attribute to other glyphs, you should assume that existing users have no problems with the current rendering and not change it: optional changes that require action by users who want it are okay; no changes to existing defaults or settings are ever okay: you will cause more issues with more impact than you solve, and you will then get many others complaining about the change.
    Only mintty renders those glyphs badly with DejaVu Sans Mono; they look normal in gvim for Cygwin and Windows, web browsers, and other apps using the same font.

  10. mintty commented on Oct 6, 2019

    @mintty
    Owner

    Released 3.0.6.

  11. changed the title [-]Unicode handling[/-] [+]Unicode glyph width handling[/+] on Nov 6, 2019
  12. mintty commented on Nov 8, 2019

    @mintty
    Owner

    Some heuristic checking reveals that 75 is a better trade-off than 70 or 80. Adjusting again.
    Limiting the procedure to ambiguous-width was an attempt still in the code, commented out, but checking shows it's not good. Double-width characters do not need special attention as they have double room anyway and don't need to be narrowed. Sample file attached.

    x-narrowing.txt

  13. mintty commented on Nov 23, 2019

    @mintty
    Owner

    Released 3.1.0.

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