Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Double width icons and the codepoint change in Nerd Fonts Material Design Icons #836

Closed
tkapias opened this issue Apr 17, 2023 · 6 comments

Comments

@tkapias
Copy link

tkapias commented Apr 17, 2023

  • os: Debian testing
  • lsd --version: 0.23.1
  • echo $TERM: tmux-256color (inside rxvt-unicode-256color)
  • echo $LS_COLORS: ""

Issue

Some icon glyphs chosen for lsd are not displayed as single wide in mono and it breaks the visual alignment with other lines.

  • I made a list of these icons and tested in urxvt, rxvt and st terminals and with different NerdFonts Mono fonts, even after patching my own.
  • Sometimes the icon is aligned to left or center but always on 2 spaces.

image

image

Those glyphs are in a collection of glyphs with a scaling problem in mono.

I printed all the glyphs in my patched font and here are the ones with a width problem:

image

Context

With its latest release NerdFonts project announced that Material Design glyphs where moved to a new codepoint and the old one will be deleted in the futur.

Exemple, the glyph used for torrents is marked as obsolete:

image

Sadly, they wrote that they fixed some scaling issue too but the new glyph is too wide even when I use the last fontpatcher.
Maybe that it will change with a next release.

Questions

The fact that these icons codepoints will soon be obsolete is a good occasion to rethink the icons choices.

Can you check if you can reproduce this issue, and find alternatives for these icons at least?

  • double width characters in icon.rs (display nicelay in the bowser but not in most terminals)
impl ByType {
    pub fn unicode() -> Self {
        ByType {
            dir: "\u{1f4c2}".into(),           // '📂'
            file: "\u{1f4c4}".into(),          // '📄'
            pipe: "\u{1f4e9}".into(),          // '📩'
            socket: "\u{1f4ec}".into(),        // '📬'
            symlink_file: "\u{1f516}".into(),  // '🔖'
            device_block: "\u{1f4bd}".into(),  // '💽'
            special: "\u{1f4df}".into(),       // '📟'
        }
    }
}

            ("api", "\u{f98c}"),             // "歷"
            ("bio", "\u{f910}"),             // "蘿"
            ("fpl", "\u{f910}"),             // "蘿"
            ("m3u8", "\u{f910}"),            // "蘿"
            ("m3u", "\u{f910}"),             // "蘿"
            ("pls", "\u{f910}"),             // "蘿"
            ("rproj", "\u{fac5}"),           // "鉶"
            ("torrent", "\u{f98c}"),         // "歷"
            ("vlc", "\u{f910}"),             // "蘿"
            ("wpl", "\u{f910}"),             // "蘿"
@tkapias
Copy link
Author

tkapias commented Apr 17, 2023

Correction about my list extracted from icon.rs:

  • The first block contains emojis and not glyphs, so it's no related to this issue. It's normal that emojis are scaled differently. I don't know where lsd use them.
impl ByType {
    pub fn unicode() -> Self {
        ByType {
            dir: "\u{1f4c2}".into(),           // '📂'
            file: "\u{1f4c4}".into(),          // '📄'
            pipe: "\u{1f4e9}".into(),          // '📩'
            socket: "\u{1f4ec}".into(),        // '📬'
            symlink_file: "\u{1f516}".into(),  // '🔖'
            device_block: "\u{1f4bd}".into(),  // '💽'
            special: "\u{1f4df}".into(),       // '📟'
        }
    }
}

@tkapias
Copy link
Author

tkapias commented Apr 17, 2023

Another correction, about the new codepoints available after the last release. I was wrong, the new ones are correctly displayed in a single column.

Example with icon used for torrents:
image

So you could just switch to the new codepoints from here : https://www.nerdfonts.com/cheat-sheet

@zwpaper
Copy link
Member

zwpaper commented Apr 23, 2023

hi @tkapias, thanks for the report and investigation, is it means that if we change the built-in icon to new codepoints, the issue should be gone?

@tkapias
Copy link
Author

tkapias commented Apr 23, 2023

Yes, it solved the issue on my setup, with a font generated from the last Nerd Fonts release.

You will have to inform the users of 'material-nf' of this change in the release because they will have to update their fonts to Nerd-Fonts =< 2.3.3.

@zwpaper
Copy link
Member

zwpaper commented Jul 4, 2023

fixed in #830

/close

@muniu-bot muniu-bot bot closed this as completed Jul 4, 2023
@muniu-bot
Copy link

muniu-bot bot commented Jul 4, 2023

@zwpaper: Closing this issue.

In response to this:

fixed in #830

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants