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

font and icon render behavior #5415

Closed
glepnir opened this issue Aug 25, 2022 · 13 comments
Closed

font and icon render behavior #5415

glepnir opened this issue Aug 25, 2022 · 13 comments
Labels

Comments

@glepnir
Copy link

glepnir commented Aug 25, 2022

Describe the bug

  1. nerd font icon small in kitty
  2. operator mono font column width big than other terminal

Hi @kovidgoyal thanks for all of your work on kitty . I used kiity 2 years but since last year I am not use computer for a while recently I update kitty and the icon behavior has changed. some nerd font icons a little small and some icons not render in kitty. compare with iterm2 wezterm gnome terminal . you can check the screenshots . about icons we talk about before check #2850 also same #2672 . we can use icon+ space to make it big .but some icons like f09a not work . this nerd font icon not render in kitty.

about question 2 also we talk at #2848 . but recently I use wezterm it works like adjust_column_width -1 . then I test this font on iterm2 alacritty gnome terminal they are have same behavior . notice that I am not meant to prove you wrong. I just wanted to say maybe you missed something , maybe not . Please correct me if I am wrong.

To Reproduce

  1. just show some nerd font icons in kitty
  2. use operator mono ssm lig font

Screenshots
left is wezterm . right is kitty with adjust_column_width -1

image

image

Environment details

kitty 0.25.2 created by Kovid Goyal
Darwin 192.168.0.101 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64
ProductName:	macOS ProductVersion:	12.5.1 BuildVersion:	21G83
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/joyce/.config/kitty/kitty.conf

Config options different from defaults:
adjust_column_width                -1
bold_font                          Operator Mono SSm Lig Medium
bold_italic_font                   Operator Mono SSm Lig Medium Italic
clipboard_control                  ('write-clipboard', 'write-primary')
confirm_os_window_close            0
cursor_blink_interval              0.0
font_family                        Operator Mono SSm Lig Book
font_size                          16.0
hide_window_decorations            2
italic_font                        Operator Mono SSm Lig Book Italic
macos_option_as_alt                3
macos_quit_when_last_window_closed True
macos_titlebar_color               455816194
mouse_hide_wait                    3.0
symbol_map:
	U+23fb - U+23fe → Symbols Nerd Font Mono
	U+2665 - U+2665 → Symbols Nerd Font Mono
	U+26a1 - U+26a1 → Symbols Nerd Font Mono
	U+2b58 - U+2b58 → Symbols Nerd Font Mono
	U+e000 - U+e00a → Symbols Nerd Font Mono
	U+e0a0 - U+e0a3 → Symbols Nerd Font Mono
	U+e0b0 - U+e0c8 → Symbols Nerd Font Mono
	U+e0ca - U+e0ca → Symbols Nerd Font Mono
	U+e0cc - U+e0d2 → Symbols Nerd Font Mono
	U+e0d4 - U+e0d4 → Symbols Nerd Font Mono
	U+e200 - U+e2a9 → Symbols Nerd Font Mono
	U+e300 - U+e3e3 → Symbols Nerd Font Mono
	U+e5fa - U+e62f → Symbols Nerd Font Mono
	U+e700 - U+e7c5 → Symbols Nerd Font Mono
	U+f000 - U+f2e0 → Symbols Nerd Font Mono
	U+f300 - U+f31c → Symbols Nerd Font Mono
	U+f400 - U+f4a9 → Symbols Nerd Font Mono
	U+f500 - U+f8ff → Symbols Nerd Font Mono
tab_bar_style                      hidden
tab_title_template                 {title}
window_border_width                (1.0, 'pt')
window_padding_width               FloatEdges(left=6.0, top=6.0, right=6.0, bottom=6.0)
Changed shortcuts:
	ctrl+shift+e → kitten hints
Colors:
	background                         #262a33   
	color0                             #282a36   
	color1                             #ff5c57   
	color10                            #5af78e   
	color11                            #f3f99d   
	color12                            #57c7ff   
	color13                            #ff6ac1   
	color14                            #9aedfe   
	color15                            #eff0eb   
	color2                             #5af78e   
	color3                             #f3f99d   
	color4                             #57c7ff   
	color5                             #ff6ac1   
	color6                             #9aedfe   
	color7                             #f1f1f0   
	color8                             #686868   
	color9                             #ff5c57   
	cursor                             #8fee96   
	cursor_text_color                  #282a36   
	foreground                         #eff0eb   

Important environment variables seen by the kitty process:
	PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
	LANG                                en_US.UTF-8
	SHELL                               /bin/zsh
	USER                                joyce

Additional context
N/A

@glepnir glepnir added the bug label Aug 25, 2022
@kovidgoyal
Copy link
Owner

nerd font icons are rendered big when they are followed by spaces. That is the same as it always was and is not going to change. 練 is not a font icon its a chinese character. If nerd fonts are using actual characters for their icons, thats a bug there, report it to them.

As for 2, it is still not my goal to have kitty's rendering match any other terminals.

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

As for 2, it is still not my goal to have kitty's rendering match any other terminals.

Maybe I can accept your statement.

but question 1 . I think you should check it. it should be work check pic1 Interface is that icon . also check Null icon is
'ﳠ in kitty but it should be render check pic 2 . icon with space should be work with all nerd icons.

I had check these behavior on those terminal they are both work . so please recheck it thanks.

Pic1 :
image

Pic 2 check Null
image

Pic 3 with NUll
image

Pic 4
image

Pic 5
image

@kovidgoyal
Copy link
Owner

there is nothing to check. That codepoint is not appropriate for
symbols. If you want to force kitty to rendering it using nerd fonts,
use symbol_map in kitty.conf as described in the FAQ. But you will not
get large rendering, because large rendering only works for PUA and
symbol codepoints, not codepoints from other languages misappropriated
by nerd fonts.

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

even use symbol map it's also same please check the debug info. i use Symbols-1000-em Nerd Font Complete Mono.ttf
in wezterm and kitty . same font but I got different behavior.

@kovidgoyal
Copy link
Owner

Put

force_ltr yes

in your kitty.conf

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

Thanks for your kind help 👍 I do it but nothing changed .


kitty 0.25.2 created by Kovid Goyal
Darwin 192.168.0.101 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64
ProductName:	macOS ProductVersion:	12.5.1 BuildVersion:	21G83
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/joyce/.config/kitty/kitty.conf

Config options different from defaults:
adjust_column_width                -1
bold_font                          Operator Mono SSm Lig Medium
bold_italic_font                   Operator Mono SSm Lig Medium Italic
clipboard_control                  ('write-clipboard', 'write-primary')
confirm_os_window_close            0
cursor_blink_interval              0.0
font_family                        Operator Mono SSm Lig Book
font_size                          16.0
force_ltr                          True
hide_window_decorations            2
italic_font                        Operator Mono SSm Lig Book Italic
macos_option_as_alt                3
macos_quit_when_last_window_closed True
macos_titlebar_color               455816194
mouse_hide_wait                    3.0
symbol_map:
	U+23fb - U+23fe → Symbols Nerd Font Mono
	U+2665 - U+2665 → Symbols Nerd Font Mono
	U+26a1 - U+26a1 → Symbols Nerd Font Mono
	U+2b58 - U+2b58 → Symbols Nerd Font Mono
	U+e000 - U+e00a → Symbols Nerd Font Mono
	U+e0a0 - U+e0a3 → Symbols Nerd Font Mono
	U+e0b0 - U+e0c8 → Symbols Nerd Font Mono
	U+e0ca - U+e0ca → Symbols Nerd Font Mono
	U+e0cc - U+e0d2 → Symbols Nerd Font Mono
	U+e0d4 - U+e0d4 → Symbols Nerd Font Mono
	U+e200 - U+e2a9 → Symbols Nerd Font Mono
	U+e300 - U+e3e3 → Symbols Nerd Font Mono
	U+e5fa - U+e62f → Symbols Nerd Font Mono
	U+e700 - U+e7c5 → Symbols Nerd Font Mono
	U+f000 - U+f2e0 → Symbols Nerd Font Mono
	U+f300 - U+f31c → Symbols Nerd Font Mono
	U+f400 - U+f4a9 → Symbols Nerd Font Mono
	U+f500 - U+f8ff → Symbols Nerd Font Mono
tab_bar_style                      hidden
tab_title_template                 {title}
window_border_width                (1.0, 'pt')
window_padding_width               FloatEdges(left=6.0, top=6.0, right=6.0, bottom=6.0)
Changed shortcuts:
	ctrl+shift+e → kitten hints
Colors:
	background                         #262a33   
	color0                             #282a36   
	color1                             #ff5c57   
	color10                            #5af78e   
	color11                            #f3f99d   
	color12                            #57c7ff   
	color13                            #ff6ac1   
	color14                            #9aedfe   
	color15                            #eff0eb   
	color2                             #5af78e   
	color3                             #f3f99d   
	color4                             #57c7ff   
	color5                             #ff6ac1   
	color6                             #9aedfe   
	color7                             #f1f1f0   
	color8                             #686868   
	color9                             #ff5c57   
	cursor                             #8fee96   
	cursor_text_color                  #282a36   
	foreground                         #eff0eb   

Important environment variables seen by the kitty process:
	PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
	LANG                                en_US.UTF-8
	SHELL                               /bin/zsh
	USER                                joyce

@kovidgoyal
Copy link
Owner

Works for me, with

kitty --debug-font-fallback --config NONE -o 'symbol_map U+fa57 Symbols Nerd Font' -o force_ltr=y sh -c 'printf "練"; read'

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

@kovidgoyal right add it into symbol map it works . I just copy the symbolmap from kitty website . the U+fa57 not include in it .

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

looks like missed some icon symbol in website.

@kovidgoyal
Copy link
Owner

There aren't any missed symbols. That is the list of actually correct PUA
codepoints. Nerd fonts using non PUA code points for symbols is a bug
in nerd fonts, not one I am going to support.

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

use these symbol map works with force_ltr no

# "Nerd Fonts - Pomicons"
symbol_map  U+E000-U+E00D Symbols Nerd Font Mono

# "Nerd Fonts - Powerline"
symbol_map U+e0a0-U+e0a2,U+e0b0-U+e0b3 Symbols Nerd Font Mono

# "Nerd Fonts - Powerline Extra"
symbol_map U+e0a3-U+e0a3,U+e0b4-U+e0c8,U+e0cc-U+e0d2,U+e0d4-U+e0d4 Symbols Nerd Font Mono

# "Nerd Fonts - Symbols original"
symbol_map U+e5fa-U+e62b Symbols Nerd Font Mono

# "Nerd Fonts - Devicons"
symbol_map U+e700-U+e7c5 Symbols Nerd Font Mono

# "Nerd Fonts - Font awesome"
symbol_map U+f000-U+f2e0 Symbols Nerd Font Mono

# "Nerd Fonts - Font awesome extension"
symbol_map U+e200-U+e2a9 Symbols Nerd Font Mono

# "Nerd Fonts - Octicons"
symbol_map U+f400-U+f4a8,U+2665-U+2665,U+26A1-U+26A1,U+f27c-U+f27c Symbols Nerd Font Mono

# "Nerd Fonts - Font Linux"
symbol_map U+F300-U+F313 Symbols Nerd Font Mono

#  Nerd Fonts - Font Power Symbols"
symbol_map U+23fb-U+23fe,U+2b58-U+2b58 Symbols Nerd Font Mono

#  "Nerd Fonts - Material Design Icons"
symbol_map U+f500-U+fd46 Symbols Nerd Font Mono

# "Nerd Fonts - Weather Icons"
symbol_map U+e300-U+e3eb Symbols Nerd Font Mono

# Misc Code Point Fixes
symbol_map U+21B5,U+25B8,U+2605,U+2630,U+2632,U+2714,U+E0A3,U+E615,U+E62B Symbols Nerd Font Mono

@glepnir
Copy link
Author

glepnir commented Aug 25, 2022

Just now you said that this is a mistake that Chinese characters as nerdfont symbol. But it's actually because the map for this symbol is missing. Many symbols do not support space to expand the display. You also think it's someone else's fault.
In your opinion all problems are someone else's fault. But I pointed out that all other terminals have consistent behavior.
So I can't understand your judgment.

@kovidgoyal
Copy link
Owner

Jesus Christ.

NERD fonts will have you replace Arabic and Chinese letters with
symbols. You don't care because you are neither Arabic or Chinese. Good
for you. However, Arabic and Chinese people will care when their text is
suddenly displayed full of random symbols.

THIS IS A BUG IN NERD FONTS. THEY CANNOT WILY NILY REPLACE GLYPHS THAT
HAVE A DEFINED MEANING IN THE UNICODE STANDARD WITH THEIR OWN JUNK.

And the rest of the terminal emulators you name are all just
perpetuating this bug.

Repository owner locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants