kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.88k stars 964 forks source link

Can't render characters with a combining unicode character #6758

Closed neevparikh closed 11 months ago

neevparikh commented 11 months ago

Describe the bug Prefacing this by saying I'm pretty sure my configuration is somehow wrong here.

I am trying to render 1 with a combining underline unicode character (so it should render as 1 with an underline).

It renders just fine in my custom bar application (sketchybar), see screenshots below, but it won't render in the terminal or my editor. The font I'm using is FiraCode Nerd Font Mono.

To Reproduce Steps to reproduce the behavior:

  1. Relevant kitty config:
    
    font_family        FiraCode Nerd Font Mono
    bold_font          auto
    italic_font        auto
    bold_italic_font   auto

font_size 14 adjust_line_height 0 adjust_column_width 0

disable_ligatures never font_features FiraCodeNFM-Ret +zero +liga +calt

2. Type this command `echo -e "\u0031\u0332"`
3. Expect to see 1 with an underline, actually see 1 with a small dot on the below-right side like it's weirdly rendered?

**Screenshots**
If applicable, add screenshots to help explain your problem.

Output of command in terminal:
<img width="25" alt="image" src="https://github.com/kovidgoyal/kitty/assets/41182432/1e26a19f-8a43-4814-9e1c-45904127b1ec">

When rendered in the same font in the custom bar application 
<img width="25" alt="image" src="https://github.com/kovidgoyal/kitty/assets/41182432/a5b425ef-99a4-4587-be9f-6b2cc63162b9">

**Environment details**

kitty 0.30.1 (6a3529b7c2) created by Kovid Goyal Darwin redacteds-Air.Dlink 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112 arm64 ProductName: macOS ProductVersion: 14.0 BuildVersion: 23A344 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: /opt/homebrew/bin/zsh Loaded config files: /Users/redacted/.config/kitty/kitty.conf Loaded config overrides: include ~/.config/kitty/themes/gruvbox_dark_hard.conf

Config options different from defaults: allow_remote_control yes font_family FiraCode Nerd Font Mono font_features: {'FiraCodeNFM-Reg': ('+zero', '+liga', '+calt')} font_size 14.0 hide_window_decorations 2 listen_on unix:/tmp/kitty-controller macos_option_as_alt 3 macos_quit_when_last_window_closed True macos_show_window_title_in none modify_font: cell_height 0 cell_width 0 remember_window_size False window_padding_width FloatEdges(left=1.0, top=1.0, right=1.0, bottom=1.0) Removed shortcuts: cmd+enter → new_window cmd+n → new_os_window cmd+r → start_resizing_window cmd+t → new_tab cmd+w → close_tab Colors: background #1d2021
color0 #1d2021
color1 #cc241d
color10 #b8bb26
color11 #fabd2f
color12 #83a598
color13 #d3869b
color14 #8ec07c
color15 #fbf1c7
color2 #98971a
color3 #d79921
color4 #458588
color5 #b16286
color6 #689d6a
color7 #a89984
color8 #7c6f64
color9 #fb4934
cursor #928374
foreground #fbf1c7
selection_background #ebdbb2
selection_foreground #928374

Important environment variables seen by the kitty process: PATH /Users/redacted/Library/Application Support/Coursier/bin:/Users/redacted/.local/bin:/opt/homebrew/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/kitty.app/Contents/MacOS:/Users/redacted/.cargo/bin:/opt/homebrew/bin LANG en_US.UTF-8 SHELL /opt/homebrew/bin/zsh USER redacted



**Additional context**
FWIW I can reproduce it with `kitty --config NONE` as well:
<img width="336" alt="image" src="https://github.com/kovidgoyal/kitty/assets/41182432/43ee6c34-9a0d-4539-9af7-8c6cc2c0e079">
kovidgoyal commented 11 months ago

Works fine for me. In general, for font problems,

1) Dont use patched fonts, there is no need in kitty, see the FAQ 2) Use --debug-font-fallback to see where the symbols are coming from. Most likely the two fonts involved dont have compatible metrics.

neevparikh commented 11 months ago

Thanks will debug this