Skip to content

Mintty incompatible with Nerd-Fonts or Font-Awesome yet. #638

Closed

Description

@nowox

I tried to install Nerd-Fonts and Font-Awesome (typically: https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/SourceCodePro/Regular/complete/Sauce%20Code%20Pro%20Nerd%20Font%20Complete%20Windows%20Compatible.ttf) on my Windows, but mintty doesn't recognize it.

I tried to remove all the font with different abnormal glyphs in Fontforge, but even if I simply open a compatible font in Fontforge and I save it as is, it become not compatible with mintty.

Windows command.exe also doesn't support such fonts, but VisualStudio or any other IDE do.

Would it be possible for mintty to support that kind of fonts?

Activity

  1. mintty commented on Mar 3, 2017

    @mintty
    Owner

    Mintty supports all fonts and works with this font:
    mintty -o Font="SauceCodePro NF"
    However, the font chooser dialog lists only fonts that are known to the system as monospace font. You may check whether that is handled properly with Fontforge.

  2. nowox commented on Mar 3, 2017

    @nowox
    Author

    Woot!

    I put this in my mintty shortcut and it works:

    mintty.exe -o Font="SauceCodePro Nerd Font" -
    

    I must note that I first tried with the wrong name mintty -o Font="SauceCodePro NF" and I did not get any error message.

  3. mintty commented on Mar 3, 2017

    @mintty
    Owner

    For me, after installing the font you linked to, mintty -o Font="SauceCodePro NF" works. Maybe, since you work on fonts with Fontforge, you have versions installed under multiple names?

  4. nowox commented on Mar 3, 2017

    @nowox
    Author

    I exactly used the font I linked and it didn't work. However the other issue I have is the dimension of the icons that looks a bit squeezed: https://ibb.co/dkdCBF

    It seems mintty consider the used font as monospace and resize all glyphs to fit in the allowed size. Would it be possible to look like this: https://github.com/ryanoasis/vim-devicons/wiki/screenshots/v0.8.x/overall-screenshot.png

  5. mintty commented on Mar 3, 2017

    @mintty
    Owner

    Mintty expands certain characters if appropriate, by a factor of two, but it does not squeeze characters to cell width (although I'm considering to do that in order to conciliate #615).
    In the screenshot, these icons seem to be displayed at double-cell width. Mintty could in theory do that and in fact there is such an experimental option already (https://github.com/mintty/mintty/wiki/CtrlSeqs#wide-characters) but there are two problems:

    • By which criteria should characters be expanded, preferrably based on Unicode information?
    • The result would not be consistent with locale-based width information which most software relies on!
  6. mintty commented on Mar 6, 2017

    @mintty
    Owner

    Code points used by “Nerd Fonts” (https://github.com/ryanoasis/nerd-fonts#glyph-sets) are in the Unicode Private Use area which means there is no “official” reference defining their properties. I see 2 options to achieve support for extended wide character handling:

    • The Nerd Fonts projects could define a set of code points/ranges considered “wide” (an obstacle being their own font-patcher option --use-single-width-glyphs) and a corresponding mintty option similar to the current “Indice wide” feature.
    • Mintty could add a generic feature to define specific character ranges as “wide” (i.e. double-cell width), probably again dynamically with control sequences.
  7. nowox commented on Mar 7, 2017

    @nowox
    Author

    After playing around for few days, I realized that SauceCodePro doesn't play well with italic, but it is not often the case:

    a

    b

    This is perhaps not related to Nerd Fonts at all.

    Regarding your remark I don't really understand what would be the problem to extend a character a bit if it's larger than a standard monospace character even though it would mask the character low it. I think those who will use such icons have to put enough spaces after it:

    drawing1

    So I think your second proposition is a good one.

  8. mintty commented on Mar 7, 2017

    @mintty
    Owner

    The clipping of italics is a consequence of the nature of fixed-cell-width terminals. It's strange though that is does not happen always in your screenshot, and I don't reproduce it with "SauceCodePro NF". Please provide your config (esp font size, maybe shortened config file) and sample text.
    Clipping within italic text could be avoided by rendering the text from right to left (perhaps slowing down a bit), maybe I'll check that.

    About wide glyphs (like icons), if the request is not to reserve extra space to them (as would be needed for sequences of wider characters like in #553) or even to display everything at proportional width (#538, which very few terminals have ever tried to implement), it should be possible to allow a hangover for them.
    But note that this would require that no output to the right neighbour cell is written; also, mintty would need to introduce a distinction between empty cells and space cells, which may turn out to be hard, don't know. Which other terminals support this?

  9. nowox commented on Mar 7, 2017

    @nowox
    Author

    As you suspected I was using another Nerd Font which is called "SauceCodePro Nerd Font". I replaced it with the link I provided and this time I don't have any issues with the italic, but the font looks quite ugly compared to the previous one. One other point is that the glyphs are not deformed anymore.

    u

    Unfortunately I forgot to backup what was in my C:\Windows\Fonts folder before removing every SauceCodePro. I have to see if I still have the buggy version at home.

    However I tested with DejaVuSansMono NF with which I have the buggy effect on italic, plus the shrank glyphs:

    l

  10. mintty commented on Mar 7, 2017

    @mintty
    Owner

    I cannot reproduce the occasionally clipped "V". Please provide a test case.

  11. mintty commented on Mar 7, 2017

    @mintty
    Owner

    I have to revise my previous statement about mintty not squeezing characters. It does in fact have such a mechanism, which was intended for single-width letters (according to the current locale metrics) of double-width glyphs (from certain East Asian fonts), e.g. "œ". This means the mechanism is desirable and useful and cannot be just dropped; as said before, reasonable criteria for different handling need to be identified.
    Also, even changing the behaviour isn't quite as straight-forward; double-width icons are arbitrarily getting clipped when scrolling the screen. Some analysis is needed.

  12. mintty commented on Mar 9, 2017

    @mintty
    Owner

    Please provide reproducible input on how to generate the screenshots from #638 (comment) and the last one (with the italics). Which terminal and programs were used? Make a screen log please (not screen shot).

  13. nowox commented on Mar 9, 2017

    @nowox
    Author
    $ cat ~/.minttyrc
    BoldAsFont=yes
    BackgroundColour=21,21,21
    Transparency=off
    Font=DejaVuSansMono NF
    Locale=en_US
    Charset=UTF-8
    Term=xterm-256color
    RightClickAction=paste
    FontHeight=13
    SwitchShortcuts=no
    WindowShortcuts=yes
    ZoomShortcuts=yes
    AltFnShortcuts=yes
    FontIsBold=no
    BoldAsColour=yes
    FontSmoothing=full
    AllowBlinking=yes
    CursorType=line
    CursorBlinks=no
    ClickTargetMod=alt
    Scrollbar=none
    Columns=104
    Rows=58
    PgUpDnScroll=yes
    
    $ vi -u NONE
    

    Then in vim8:

    i"Hello World!"
    <ESC>
    Y100p
    :syn on
    :set ft=c
    :highlight String cterm=italic
    :set cursorcolumn
    

    You should get this:

    pp

  14. mintty commented on Mar 9, 2017

    @mintty
    Owner

    No, I don't, no italics following your instructions. And what's vim8?
    Instead of instructions how to create this picture you could also provide a screen log (with mintty --log or script from the util-linux package).

  15. nowox commented on Mar 9, 2017

    @nowox
    Author

    Sorry about that vim8 is simply vim version 8:

    $ vi --version | head -n1
    VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 26 2016 09:52:22)
    

    And here is the log:

    https://gist.github.com/nowox/c07ed5d1d94d0e62634156736fb1217d

    With this I get this:

    snap000270

    I can also reproduce it without vim:

    kkkk

    And the log is this:

    �]10;#d0d0d0��]11;#151515��]12;#FD9D4F��]4;262;#FD9D4F��]4;0;#252525��]4;8;#4a5a5a��]4;1;#AC4142��]4;9;#b26364��]4;2;#90A959��]4;10;#A6BB7B��]4;3;#F4BF75��]4;11;#F8D5A5��]4;4;#6A9FB5��]4;12;#8CB5C6��]4;5;#AA759F��]4;13;#BE95B5��]4;6;#75B5AA��]4;14;#97C7BE��]4;7;#D0D0D0��]4;15;#F5F5F5�$echo -e '\e[3m""""""'
    �[3m""""""
    $
    
  16. 6 remaining items

  17. mintty commented on Mar 11, 2017

    @mintty
    Owner

    Released some improvements in 2.7.5, please check.
    Full overhang enabling for italics would be more fiddly however. Not yet sure whether it's worth the effort.

  18. nowox commented on Mar 13, 2017

    @nowox
    Author

    Nice improvements, thanks for your time. It is good to mention that only monospace fonts are listed.

    Regarding italics, the latest version on the master branch doesn't solve the issue on vim with set cursorcolumn on and this font enabled:

    Font=DejaVuSansMono NF
    

    This is not a real issue for me since I am not using this font. And again this is another issue out of topic.

    So thanks anyway.

  19. mintty commented on Mar 16, 2017

    @mintty
    Owner

    Full overhang enabling for italics would be more fiddly however. Not yet sure whether it's worth the effort.

    In any case, it was a challenge. Now supported.

  20. mintty commented on Apr 13, 2017

    @mintty
    Owner

    Released 2.7.6.

  21. mintty commented on Oct 23, 2017

    @mintty
    Owner

    Released 2.8.0.

  22. mintty commented on May 20, 2020

    @mintty
    Owner

    Released 3.1.5 with explicit character width attribute support.

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