Skip to content

Width of secondary fonts (NerdFont Private) via FontChoice appear clipped #979

Closed

Description

@awkwong-whi

Using a similar configuration as shown in the wiki Tips, I set the following:

Font=Cascadia Code
FontChoice=Private:3
Font3=SauceCodePro NF
CharNarrowing=50

The Powerline Glyphs appear (mostly) correct. However, the NerdFont glyphs appear to be clipped regardless of the CharNarrowing value.

image

In this screenshot, the ovals (made from Powerline glyphs and bg/fg flipping) appear mostly correct (there's a slight line that appears on the right before the closing round glyph). However, the NerdFont symbols appear clipped. The symbols are:

  • Debug: f53e
  • Info: f7fb
  • Notice: f707
  • Warn: f525
  • Error: f65c
  • Json: f668

This only occurs if the FontChoice is used. The following image is the same screen but FontChoice is not used and relies on the primary font to provide the NerdFont glyphs:

image

The rendering of the glpyhs look great in this context.

Activity

  1. mintty commented on Mar 26, 2020

    @mintty
    Owner

    Please provide a file (e.g. a screen log) that produces this with cat.

  2. mintty commented on Mar 26, 2020

    @mintty
    Owner

    Also, which font do you use? Precise download link please.

  3. mintty commented on Mar 26, 2020

    @mintty
    Owner

    The symbols are: ...

    ??? The codes you listed do not produce the glyphs from your screenshot.
    Please provide a consistent and reproducible report or I can only close the issue.

  4. awkwong-whi commented on Mar 27, 2020

    @awkwong-whi
    Author

    This is the raw output (gzipped).

    raw.out.gz

    The fonts I use:

    It seems to do with with any of the NerdFonts for me.

    The NF glyphs:

    • Debug --> ef 97 a3 --> f5e3 nf-mdi-bug (sorry, i mistyped above)
    • Info --> ef 9f bb --> f7fb nf-mdi-information
    • Notice --> ef 9c 87 --> f707 nf-mdi-eye
    • Warn --> ef 94 a5 --> f525 nf-mdi-alert
    • Error --> ef 99 9c --> f65c nf-mdi-close_octogon
    • Json --> ef 99 a8 --> f668 nf-mdi-json
  5. awkwong-whi commented on Mar 27, 2020

    @awkwong-whi
    Author

    I discovered that if I use the "Mono" version it seems to be much happier when used as a secondary.

  6. mintty commented on Mar 27, 2020

    @mintty
    Owner

    With your fonts and your config, I get this:
    979

    • no clipping.
  7. awkwong-whi commented on Mar 30, 2020

    @awkwong-whi
    Author

    If the secondary font uses the NerdFonts non-mono (which means the Private Glyphs are not all forced into single width -- and in the case of those selected glyphs, they are wider than one cell), clipping will occur.

    If we use Font=Cascadia Code as the Primary Font, and Font3=CascaydiaCove NF with FontChoice=Private:3 as the example:

    • Caskaydia Cove Regular Nerd Font Complete Mono Windows Compatible.ttf
      • renders correctly -- but the glyphs will be tiny
        image
    • Cascaydia Cove Regular Nerd Font Complete Windows Compatible.ttf
      • will be clipped
        image

    If we use Font=CascaydiaCove NF and do not use FontChoice:

    • Cascaydia Cove Regular Nerd Font Complete Mono Windows Compatible.ttf

      • renders correctly -- but the glyphs will be tiny
        image
    • Cascaydia Cove Regular Nerd Font Complete Windows Compatible.ttf

      • renders correctly with wide glyphs
        image
  8. mintty commented on Mar 30, 2020

    @mintty
    Owner

    With this configuration:

    Font=Cascadia Code
    FontChoice=Private:3
    Font3=CascaydiaCove NF
    

    I do not see the first 5 characters (DEBUG...ERROR) at all. While puzzling at the first glance, it sheds more light on the issue: Using the glyph checking escape sequence OSC 7771, it is revealed that the font used for them actually does not contain the glyphs. This means that in some environment, for the display of those characters some other font is used as determined by the Windows font fallback mechanism. In that case, mintty has no control about the font width anymore.

  9. mintty commented on Mar 30, 2020

    @mintty
    Owner

    There seems to be some confusion about the font and its precise name. I had misspelled above, font name is with "k" and then the glyphs are shown, but not clipped.
    I yet have to see a precise configuration, with precise font references, that reproduces an issue.

  10. awkwong-whi commented on Mar 31, 2020

    @awkwong-whi
    Author

    Lets try the following:

    Primary Font is the reference Cascadia Code (as provided by Microsoft) -- to which the Powerline glyphs are not present. Lets use this one:

    For Font3, let us use the most recent patched font with large glyphs from nerd-fonts github here:

    This should then make this configuration reproduce the issue:

    Font=Cascadia Code
    FontChoice=Private:3
    Font3=CaskaydiaCove NF
    
  11. mintty commented on Mar 31, 2020

    @mintty
    Owner

    With this setting, I see:
    Nerdfonts

  12. awkwong-whi commented on Mar 31, 2020

    @awkwong-whi
    Author

    Do you have "Caskaydia Cove Regular Nerd Font Complete Mono Windows Compatible.ttf" installed,
    or "Caskaydia Cove Regular Nerd Font Complete Windows Compatible.ttf" installed?

    The one with Mono has all glyphs forced into a monospaced cell width.
    The one without the mono has large glyphs.

    I've been using Windows 10 "Font settings" to verify which font files are referenced.

  13. mintty commented on Apr 1, 2020

    @mintty
    Owner

    OK, I seem to have had an issue with font management; installing over a previous font with the same name did not succeed (or I should have rebooted to clear Windows font caches, whatever). It's also not helpful that this nerdy font project publishes font variations with identical names...
    Issue reproduced.
    Currently, private characters are explicitly excluded from the auto-narrowing heuristics (CharNarrowing=50). To be checked.

  14. awkwong-whi commented on Apr 1, 2020

    @awkwong-whi
    Author

    It's also not helpful that this nerdy font project publishes font variations with identical names...

    I absolutely agree. That part is rather frustrating.

  15. mintty commented on Apr 1, 2020

    @mintty
    Owner

    You can actually work around this issue with setting Charwidth=ambig-wide.

  16. 20 remaining items

  17. BrianInglis commented on Apr 14, 2020

    @BrianInglis

    Might be good to run any OSC esc seq ideas past Thomas Dickey to discuss if similar functionality already exists or where it would best fit architecturally, and thoughts on supporting non-standard fonts' charsets.
    Maybe also @ryanoasis about support of and possibly migration to alternative standard codepoints in PUA in their scripts.

  18. mintty commented on Apr 14, 2020

    @mintty
    Owner

    Non-standard charsets outside the Unicode Private ranges should and shall not be supported.
    Considering that Nerdfonts captures existing Unicode ranges actually reduces my motivation to support their peculiarities beyond the Powerline geometrics which raise issues for many people.

    Apart from defining specific ranges, I could also imagine a character attribute that would simply make any character wide or narrow. About escape sequences, I've checked EMCA-48 and there are a few sequences already that might be applicable for such a purpose, for example PEC Presentation Expand Or Contract (CSI Ps SP Z).

  19. awkwong-whi commented on Apr 15, 2020

    @awkwong-whi
    Author

    I'll re-run the scan ignoring the 2%.

  20. mintty commented on Apr 15, 2020

    @mintty
    Owner

    Two notes about the newer list:

    • It includes a bunch of code positions for which I see no glyphs, starting from U+E0B8.
    • The 16 geometric Powerline symbols from E0B0 should all be narrow, independently from glyph scanning.
  21. added a commit that references this issue on Apr 15, 2020
  22. mintty commented on May 20, 2020

    @mintty
    Owner

    Released 3.1.5 with explicit character width attribute support.

  23. mintty commented on Sep 3, 2021

    @mintty
    Owner

    Released 3.5.1.

  24. mintty commented on Sep 17, 2024

    @mintty
    Owner

    Released 3.7.5.

  25. added a commit that references this issue on Jan 1, 2025
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