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

Characters from the range U+F900 to U+FAFF are displayed with a width of two #637

Closed
ariasuni opened this issue Jun 27, 2021 · 10 comments
Closed

Comments

@ariasuni
Copy link

🎯 Subject of the issue

ogham/exa can display icons using Nerd Fonts codepoints. However, it seems that some icons are displayed with one character more than expected, like U+FABF, and there’s no way, as far as I know, to accurately find out which size it is to workaround this problem.

🔧 Your Setup

  • Hack Nerd Font Mono.tff 2.1.0 and Hack Regular Nerd Font Complete.ttf 2.1.0
  • Konsole, Kitty
  • Ubuntu 20.04, Arch Linux

★ Screenshots

Screenshot_20210627_234208 Screenshot_20210627_234232

@IzhakJakov
Copy link

Same thing happens to me on MacOS using iTerm

image

@eliminmax
Copy link

eliminmax commented Dec 2, 2021

Ran into the same issue on gnome-terminal and kitty, on Pop!_OS 21.04

kitty:
kitty-nf

gnome-terminal:
gnome-terminal-nf

@xsrvmy
Copy link

xsrvmy commented Dec 31, 2021

The U+F900 to U+FAFF range is used for CJK characters actually, so the terminal is expected double width characters there.

@Finii
Copy link
Collaborator

Finii commented Dec 31, 2021

Just stumbled over this in Windows Terminal code:

        UnicodeRange{ 0xe000, 0xf8ff, CodepointWidth::Ambiguous },
        UnicodeRange{ 0xf900, 0xfaff, CodepointWidth::Wide },

The font (i.e. Nerd Font) has no influence on rendering if the terminal overrides our info.

@ariasuni
Copy link
Author

ariasuni commented Jan 5, 2022

I feel like Nerd Fonts should avoid this Unicode range if a lot of terminal have problem with it, to be honest, but I’m not sure how practical or feasible it is.

@tywtyw2002
Copy link

I suggest we should skip the range F900 - FAFF.

This range is design for CJK, and lots of programs hard code CJK features in this range.

Also, this is a problem for CJK users.

For example,

  • Icons display as Chinese without use nerd fonts.

Screen Shot 2022-03-02 at 18 05 46

@Finii
Copy link
Collaborator

Finii commented Mar 3, 2022

@tywtyw2002 see #574 and finally #716

@DHowett
Copy link

DHowett commented Jun 20, 2022

The font (i.e. Nerd Font) has no influence on rendering if the terminal overrides our info.

In general--because there is no guarantee that a terminal-based application is even running on the same host as the terminal emulator--you cannot rely on the font to tell you how big a glyph is supposed to be. An application trying to simply print text would need to know what font is set (and perhaps even load it up and parse it, when it may not even exist on that system; output could be going to a printer, etc.) to accurately determine how to do so. Terminal emulators must therefore override all font info based on a standard that font authors and terminal emulator authors agree to. 😄

@Finii
Copy link
Collaborator

Finii commented May 1, 2023

Glyphs finally dropped with v3.0.0

Copy link
Contributor

github-actions bot commented Nov 6, 2023

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants