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

Font fallback with some emoji characters when using PragmataPro font #6084

Closed VitGottwald closed 1 year ago

VitGottwald commented 1 year ago

Describe the bug When using PragmataPro font, some emoji characters fall back to to Apple Color Emoji even though PragmataPro defines these characters (for example U+231a Watch, U+231b Hourglass).

To Reproduce Steps to reproduce the behavior:

  1. Install PragmataPro font
  2. Add font_family PragmataPro Mono Liga to kitty.conf
  3. Start kitty with kitty --debug-font-fallback
  4. Run curl https://raw.githubusercontent.com/fabrizioschiavi/pragmatapro-semiotics/main/Symbols.csv 2>/dev/null | head -n 34 | tail -n 4
  5. See messages about fallback to Apple Color Emoji :
U+231a emoji_presentation Face(family=Apple Color Emoji, full_name=Apple Color Emoji, postscript_name=AppleColorEmoji, path=/System/Library/Fonts/Apple Color Emoji.ttc, units_per_em=800, ascent=30.0, descent=9.4, leading=0.0, point_sz=0.0, scaled_point_sz=30.0, underline_position=-3.8 underline_thickness=1.9) (new face)
U+231b emoji_presentation Face(family=Apple Color Emoji, full_name=Apple Color Emoji, postscript_name=AppleColorEmoji, path=/System/Library/Fonts/Apple Color Emoji.ttc, units_per_em=800, ascent=30.0, descent=9.4, leading=0.0, point_sz=0.0, scaled_point_sz=30.0, underline_position=-3.8 underline_thickness=1.9)

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

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 config /tmp/kitty.conf containing single line font_family PragmataPro Mono Liga by running kitty --debug-font-fallback --config /tmp/kitty.conf

VitGottwald commented 1 year ago

The same problem happens when using Iosevka Term font. However, it is not clear whether Iosevka implements these chars.

image
kovidgoyal commented 1 year ago

kitty prefers using Emoji fonts for Emoji symbols. If you want to force use of a non-emoji font then use symbol_map but as you discovered, that wont change the width of the character. You can change the width of some emoji characters using the emoji variation selector combining chars, if the emoji is marked as variable width in the standard.