kovidgoyal / kitty

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

Some emoji characters get displayed double width in PragmataPro font #6085

Closed VitGottwald closed 1 year ago

VitGottwald commented 1 year ago

Describe the bug When using PragmataPro and specifying symbol_map to use PragmataPro font for various emoji characters (to avoid falling back to Apple Color Emoji) the characters get printed double width and bold.

To Reproduce Steps to reproduce the behavior:

  1. Install PragmataPro font
  2. Create a kitty config /tmp/kitty.conf with the following two lines
    font_family PragmataPro Mono Liga
    symbol_map U+231a,U+231b PragmataPro Mono Liga
  3. start kitty by running kitty --config /tmp/kitty.conf
  4. inside kitty run curl https://raw.githubusercontent.com/fabrizioschiavi/pragmatapro-semiotics/main/Symbols.csv 2>/dev/null | head -n 34 | tail -n 4
  5. See that watch and hourglass symbols get printed double width and bold

Screenshots image

Environment details

kitty 0.27.1 () created by Kovid Goyal
Darwin PP69WP66CY 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64
ProductName:        macOS ProductVersion:       13.2.1 BuildVersion:        22D68
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:
  /tmp/kitty.conf

Config options different from defaults:
font_family PragmataPro Mono Liga
symbol_map:
    U+231a - U+231a → PragmataPro Mono Liga
    U+231b - U+231b → PragmataPro Mono Liga

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                en_US.UTF-8
    VISUAL                              nvim
    EDITOR                              nvim
    SHELL                               /bin/zsh
    USER                                vit
    LC_CTYPE                            UTF-8

Additional context Reproduced with minimal /tmp/kitty.conf containing only two lines

font_family PragmataPro Mono Liga
symbol_map U+231a,U+231b PragmataPro Mono Liga
VitGottwald commented 1 year ago

Similar issue happens when using Iosevka Term font (however, it looks like Iosevka does not implement these chars).

image
kovidgoyal commented 1 year ago

The width of characters is fixed by the unicode standard. You cannot control it. If users could change the width of characters then it would be impossible for terminal programs to draw any text with any fidelity.

VitGottwald commented 1 year ago

I did not know that. But when I open text with these charactes in TextEdit and use the font it does not look any wider than other characters

image
kovidgoyal commented 1 year ago

terminal emulators are monospaced. Character widths are well defined in number of cells in the monospace grid.