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

Monaspace font ligatures only partially rendering correctly #8182

Closed
jwbackhouse opened this issue Jan 1, 2025 · 5 comments
Closed

Monaspace font ligatures only partially rendering correctly #8182

jwbackhouse opened this issue Jan 1, 2025 · 5 comments
Labels

Comments

@jwbackhouse
Copy link

Describe the bug
When using the latest (v1.101) version of the GitHub Monaspace font, only some of the ligatures are rendering correctly - even after manually setting the font features as per this suggestion in another issue

To Reproduce
Install Monaspace by cloning repo and running install script as per README
Select Monaspace Argon Var as the Kitty font (or any of the other variants)
Apply the settings described in this issue

Screenshots
If no manual font-feature settings are applied, you see no ligatures at all:
image

With the settings as per the linked issue, only certain ligatures are visible (which happen to be those that appear in red in the terminal, interestingly):
image

Expected ligatures can be found here

Environment details

kitty 0.37.0 (2531c31d02) created by Kovid Goyal
Darwin NVT-MB-JB 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031 arm64
ProductName:		macOS ProductVersion:		15.1.1 BuildVersion:		24B91
OpenGL: '4.1 Metal - 89.3' Detected version: 4.1
Frozen: True
Fonts:
  medium: MonaspaceArgonVar-Regular: /Users/james.backhouse/Library/Fonts/MonaspaceArgonVarVF[wght,wdth,slnt].ttf
          Features: ()
    bold: MonaspaceArgonVar-SemiBold: /Users/james.backhouse/Library/Fonts/MonaspaceArgonVarVF[wght,wdth,slnt].ttf
          Features: ('ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'ss09', 'calt', 'liga')
  italic: MonaspaceArgonVar-Italic: /Users/james.backhouse/Library/Fonts/MonaspaceArgonVarVF[wght,wdth,slnt].ttf
          Features: ('ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'ss09', 'calt', 'liga')
      bi: MonaspaceArgonVar-SemiBoldItalic: /Users/james.backhouse/Library/Fonts/MonaspaceArgonVarVF[wght,wdth,slnt].ttf
          Features: ('ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'ss09', 'calt', 'liga')
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/james.backhouse/.config/kitty/kitty.conf
Loaded config overrides:
  allow_remote_control yes

Config options different from defaults:
allow_remote_control    yes
box_drawing_scale       (0.002, 2.0, 3.0, 4.0)
copy_on_select          clipboard
cursor_trail            3
enabled_layouts         ['tall:bias=80;full_size=1;mirrored=false', 'splits', 'stack']
font_family             family='Monaspace Argon Var' variable_name=MonaspaceArgonVar style=MonaspaceArgonVar-Regular
font_features:
{'MonaspaceArgonVar': ('ss01',
                       'ss02',
                       'ss03',
                       'ss04',
                       'ss05',
                       'ss06',
                       'ss07',
                       'ss08',
                       'ss09',
                       'calt',
                       'liga'),
 'MonaspaceArgonVar-Bold': ('ss01',
                            'ss02',
                            'ss03',
                            'ss04',
                            'ss05',
                            'ss06',
                            'ss07',
                            'ss08',
                            'ss09',
                            'calt',
                            'liga'),
 'MonaspaceArgonVar-BoldItalic': ('ss01',
                                  'ss02',
                                  'ss03',
                                  'ss04',
                                  'ss05',
                                  'ss06',
                                  'ss07',
                                  'ss08',
                                  'ss09',
                                  'calt',
                                  'liga'),
 'MonaspaceArgonVar-ExtraBold': ('ss01',
                                 'ss02',
                                 'ss03',
                                 'ss04',
                                 'ss05',
                                 'ss06',
                                 'ss07',
                                 'ss08',
                                 'ss09',
                                 'calt',
                                 'liga'),
 'MonaspaceArgonVar-ExtraBoldItalic': ('ss01',
                                       'ss02',
                                       'ss03',
                                       'ss04',
                                       'ss05',
                                       'ss06',
                                       'ss07',
                                       'ss08',
                                       'ss09',
                                       'calt',
                                       'liga'),
 'MonaspaceArgonVar-ExtraLightItalic': ('ss01',
                                        'ss02',
                                        'ss03',
                                        'ss04',
                                        'ss05',
                                        'ss06',
                                        'ss07',
                                        'ss08',
                                        'ss09',
                                        'calt',
                                        'liga'),
 'MonaspaceArgonVar-Italic': ('ss01',
                              'ss02',
                              'ss03',
                              'ss04',
                              'ss05',
                              'ss06',
                              'ss07',
                              'ss08',
                              'ss09',
                              'calt',
                              'liga'),
 'MonaspaceArgonVar-Light': ('ss01',
                             'ss02',
                             'ss03',
                             'ss04',
                             'ss05',
                             'ss06',
                             'ss07',
                             'ss08',
                             'ss09',
                             'calt',
                             'liga'),
 'MonaspaceArgonVar-LightItalic': ('ss01',
                                   'ss02',
                                   'ss03',
                                   'ss04',
                                   'ss05',
                                   'ss06',
                                   'ss07',
                                   'ss08',
                                   'ss09',
                                   'calt',
                                   'liga'),
 'MonaspaceArgonVar-Medium': ('ss01',
                              'ss02',
                              'ss03',
                              'ss04',
                              'ss05',
                              'ss06',
                              'ss07',
                              'ss08',
                              'ss09',
                              'calt',
                              'liga'),
 'MonaspaceArgonVar-MediumItalic': ('ss01',
                                    'ss02',
                                    'ss03',
                                    'ss04',
                                    'ss05',
                                    'ss06',
                                    'ss07',
                                    'ss08',
                                    'ss09',
                                    'calt',
                                    'liga'),
 'MonaspaceArgonVar-SemiBold': ('ss01',
                                'ss02',
                                'ss03',
                                'ss04',
                                'ss05',
                                'ss06',
                                'ss07',
                                'ss08',
                                'ss09',
                                'calt',
                                'liga'),
 'MonaspaceArgonVar-SemiBoldItalic': ('ss01',
                                      'ss02',
                                      'ss03',
                                      'ss04',
                                      'ss05',
                                      'ss06',
                                      'ss07',
                                      'ss08',
                                      'ss09',
                                      'calt',
                                      'liga'),
 'MonaspaceArgonVar-SemiWideBold': ('ss01',
                                    'ss02',
                                    'ss03',
                                    'ss04',
                                    'ss05',
                                    'ss06',
                                    'ss07',
                                    'ss08',
                                    'ss09',
                                    'calt',
                                    'liga'),
 'MonaspaceArgonVar-SemiWideBoldItalic': ('ss01',
                                          'ss02',
                                          'ss03',
                                          'ss04',
                                          'ss05',
                                          'ss06',
                                          'ss07',
                                          'ss08',
                                          'ss09',
                                          'calt',
                                          'liga'),
 'MonaspaceArgonVar-SemiWideExtraBold': ('ss01',
                                         'ss02',
                                         'ss03',
                                         'ss04',
                                         'ss05',
                                         'ss06',
                                         'ss07',
                                         'ss08',
                                         'ss09',
                                         'calt',
                                         'liga'),
 'MonaspaceArgonVar-SemiWideExtraBoldItalic': ('ss01',
                                               'ss02',
                                               'ss03',
                                               'ss04',
                                               'ss05',
                                               'ss06',
                                               'ss07',
                                               'ss08',
                                               'ss09',
                                               'calt',
                                               'liga'),
 'MonaspaceArgonVar-SemiWideExtraLight': ('ss01',
                                          'ss02',
                                          'ss03',
                                          'ss04',
                                          'ss05',
                                          'ss06',
                                          'ss07',
                                          'ss08',
                                          'ss09',
                                          'calt',
                                          'liga'),
 'MonaspaceArgonVar-SemiWideExtraLightItalic': ('dlig',
                                                'ss01',
                                                'ss02',
                                                'ss03',
                                                'ss04',
                                                'ss05',
                                                'ss06',
                                                'ss07',
                                                'ss08',
                                                'ss09',
                                                'calt',
                                                'liga'),
 'MonaspaceArgonVar-SemiWideItalic': ('dlig',
                                      'ss01',
                                      'ss02',
                                      'ss03',
                                      'ss04',
                                      'ss05',
                                      'ss06',
                                      'ss07',
                                      'ss08',
                                      'ss09',
                                      'calt',
                                      'liga'),
 'MonaspaceArgonVar-SemiWideLight': ('dlig',
                                     'ss01',
                                     'ss02',
                                     'ss03',
                                     'ss04',
                                     'ss05',
                                     'ss06',
                                     'ss07',
                                     'ss08',
                                     'ss09',
                                     'calt',
                                     'liga'),
 'MonaspaceArgonVar-SemiWideLightItalic': ('dlig',
                                           'ss01',
                                           'ss02',
                                           'ss03',
                                           'ss04',
                                           'ss05',
                                           'ss06',
                                           'ss07',
                                           'ss08',
                                           'ss09',
                                           'calt',
                                           'liga'),
 'MonaspaceArgonVar-SemiWideMedium': ('dlig',
                                      'ss01',
                                      'ss02',
                                      'ss03',
                                      'ss04',
                                      'ss05',
                                      'ss06',
                                      'ss07',
                                      'ss08',
                                      'ss09',
                                      'calt',
                                      'liga'),
 'MonaspaceArgonVar-SemiWideMediumItalic': ('dlig',
                                            'ss01',
                                            'ss02',
                                            'ss03',
                                            'ss04',
                                            'ss05',
                                            'ss06',
                                            'ss07',
                                            'ss08',
                                            'ss09',
                                            'calt',
                                            'liga'),
 'MonaspaceArgonVar-SemiWideRegular': ('dlig',
                                       'ss01',
                                       'ss02',
                                       'ss03',
                                       'ss04',
                                       'ss05',
                                       'ss06',
                                       'ss07',
                                       'ss08',
                                       'ss09',
                                       'calt',
                                       'liga'),
 'MonaspaceArgonVar-SemiWideSemiBold': ('dlig',
                                        'ss01',
                                        'ss02',
                                        'ss03',
                                        'ss04',
                                        'ss05',
                                        'ss06',
                                        'ss07',
                                        'ss08',
                                        'ss09',
                                        'calt',
                                        'liga'),
 'MonaspaceArgonVar-SemiWideSemiBoldItalic': ('dlig',
                                              'ss01',
                                              'ss02',
                                              'ss03',
                                              'ss04',
                                              'ss05',
                                              'ss06',
                                              'ss07',
                                              'ss08',
                                              'ss09',
                                              'calt',
                                              'liga'),
 'MonaspaceArgonVar-WideBold': ('dlig',
                                'ss01',
                                'ss02',
                                'ss03',
                                'ss04',
                                'ss05',
                                'ss06',
                                'ss07',
                                'ss08',
                                'ss09',
                                'calt',
                                'liga'),
 'MonaspaceArgonVar-WideBoldItalic': ('dlig',
                                      'ss01',
                                      'ss02',
                                      'ss03',
                                      'ss04',
                                      'ss05',
                                      'ss06',
                                      'ss07',
                                      'ss08',
                                      'ss09',
                                      'calt',
                                      'liga'),
 'MonaspaceArgonVar-WideExtraBold': ('dlig',
                                     'ss01',
                                     'ss02',
                                     'ss03',
                                     'ss04',
                                     'ss05',
                                     'ss06',
                                     'ss07',
                                     'ss08',
                                     'ss09',
                                     'calt',
                                     'liga'),
 'MonaspaceArgonVar-WideExtraBoldItalic': ('dlig',
                                           'ss01',
                                           'ss02',
                                           'ss03',
                                           'ss04',
                                           'ss05',
                                           'ss06',
                                           'ss07',
                                           'ss08',
                                           'ss09',
                                           'calt',
                                           'liga'),
 'MonaspaceArgonVar-WideExtraLight': ('dlig',
                                      'ss01',
                                      'ss02',
                                      'ss03',
                                      'ss04',
                                      'ss05',
                                      'ss06',
                                      'ss07',
                                      'ss08',
                                      'ss09',
                                      'calt',
                                      'liga'),
 'MonaspaceArgonVar-WideExtraLightItalic': ('dlig',
                                            'ss01',
                                            'ss02',
                                            'ss03',
                                            'ss04',
                                            'ss05',
                                            'ss06',
                                            'ss07',
                                            'ss08',
                                            'ss09',
                                            'calt',
                                            'liga'),
 'MonaspaceArgonVar-WideItalic': ('dlig',
                                  'ss01',
                                  'ss02',
                                  'ss03',
                                  'ss04',
                                  'ss05',
                                  'ss06',
                                  'ss07',
                                  'ss08',
                                  'ss09',
                                  'calt',
                                  'liga'),
 'MonaspaceArgonVar-WideLight': ('dlig',
                                 'ss01',
                                 'ss02',
                                 'ss03',
                                 'ss04',
                                 'ss05',
                                 'ss06',
                                 'ss07',
                                 'ss08',
                                 'ss09',
                                 'calt',
                                 'liga'),
 'MonaspaceArgonVar-WideLightItalic': ('dlig',
                                       'ss01',
                                       'ss02',
                                       'ss03',
                                       'ss04',
                                       'ss05',
                                       'ss06',
                                       'ss07',
                                       'ss08',
                                       'ss09',
                                       'calt',
                                       'liga'),
 'MonaspaceArgonVar-WideMedium': ('dlig',
                                  'ss01',
                                  'ss02',
                                  'ss03',
                                  'ss04',
                                  'ss05',
                                  'ss06',
                                  'ss07',
                                  'ss08',
                                  'ss09',
                                  'calt',
                                  'liga'),
 'MonaspaceArgonVar-WideMediumItalic': ('dlig',
                                        'ss01',
                                        'ss02',
                                        'ss03',
                                        'ss04',
                                        'ss05',
                                        'ss06',
                                        'ss07',
                                        'ss08',
                                        'ss09',
                                        'calt',
                                        'liga'),
 'MonaspaceArgonVar-WideRegular': ('dlig',
                                   'ss01',
                                   'ss02',
                                   'ss03',
                                   'ss04',
                                   'ss05',
                                   'ss06',
                                   'ss07',
                                   'ss08',
                                   'ss09',
                                   'calt',
                                   'liga'),
 'MonaspaceArgonVar-WideSemiBold': ('dlig',
                                    'ss01',
                                    'ss02',
                                    'ss03',
                                    'ss04',
                                    'ss05',
                                    'ss06',
                                    'ss07',
                                    'ss08',
                                    'ss09',
                                    'calt',
                                    'liga'),
 'MonaspaceArgonVar-WideSemiBoldItalic': ('dlig',
                                          'ss01',
                                          'ss02',
                                          'ss03',
                                          'ss04',
                                          'ss05',
                                          'ss06',
                                          'ss07',
                                          'ss08',
                                          'ss09',
                                          'calt',
                                          'liga')}
font_size               12.0
listen_on               unix:/tmp/mykitty
macos_option_as_alt     2
modify_font:
    cell_height 2.7
tab_bar_align           center
tab_bar_style           slant
Added shortcuts:
	cmd+d →  launch --location=hsplit
	ctrl+f →  launch --type=overlay --stdin-source=@screen_scrollback /opt/homebrew/bin/fzf --no-sort --no-mouse --exact -i
	ctrl+h →  [--when-focus-on=var:IS_NVIM]no-op, neighboring_window left
	ctrl+j →  [--when-focus-on=var:IS_NVIM]no-op, neighboring_window down
	ctrl+k →  [--when-focus-on=var:IS_NVIM]no-op, neighboring_window up
	ctrl+l →  [--when-focus-on=var:IS_NVIM]no-op, neighboring_window right
	f7 →  layout_action rotate
	shift+down →  move_window down
	shift+left →  move_window left
	shift+right →  move_window right
	shift+up →  move_window up
Changed shortcuts:
	cmd+k →  no-op
	cmd+m →  toggle_layout stack
	cmd+r →  launch --location=vsplit
	ctrl+cmd+, →  reload_config
	kitty_mod+left →  resize_window narrower 10
	kitty_mod+right →  resize_window wider 10
	opt+cmd+r →  reset_terminal
	shift+cmd+/ →  open_kitty_website
Colors:
	active_border_color     #7aa2f7   
	active_tab_background   #7aa2f7   
	active_tab_foreground   #1f2335   
	background              #24283b   
	color0                  #1d202f   
	color1                  #f7768e   
	color10                 #9ece6a   
	color11                 #e0af68   
	color12                 #7aa2f7   
	color13                 #bb9af7   
	color14                 #7dcfff   
	color15                 #c0caf5   
	color16                 #ff9e64   
	color17                 #db4b4b   
	color2                  #9ece6a   
	color3                  #e0af68   
	color4                  #7aa2f7   
	color5                  #bb9af7   
	color6                  #7dcfff   
	color7                  #a9b1d6   
	color8                  #414868   
	color9                  #f7768e   
	cursor                  #c0caf5   
	cursor_text_color       #24283b   
	foreground              #c0caf5   
	inactive_border_color   #292e42   
	inactive_tab_background #292e42   
	inactive_tab_foreground #545c7e   
	selection_background    #2e3c64   
	selection_foreground    #c0caf5   
	url_color               #73daca   

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

Additional context
Reproducible with kitty --config NONE

All ligatures work correctly in VS Code. More (but still not all) work correctly in Ghostty

Monaspace fonts are listed in MacOS font book as fixed width

@jwbackhouse jwbackhouse added the bug label Jan 1, 2025
@kovidgoyal
Copy link
Owner

Is this something specific to a monaspace update?

@kovidgoyal
Copy link
Owner

Oh and ligatures dont happen if parts of the composing characters are in different colors. If you wan to test type in an editor without syntax highlighting definitely not at a shell prompt.

@kovidgoyal
Copy link
Owner

I looked at this briefly, as far as I can tell the font doesnt have either CALT or LIGA ligatures. I tried

hb-shape --features "+calt,+liga" "/usr/share/fonts/OTF/MonaspaceArgonVarVF[wght,wdth,slnt].ttf" '==='

which gives

[equal=0+1240|equal=1+1240|equal=2+1240]

which gives us the same glyph being repeated 3 times. AKA not a ligature. If harfbuzz doesn't find the ligature then kitty cannot either, since it uses harfbuzz for shaping. (hb-shape is the harfbuzz shaping utility).

You should probably take this up with the font developers. If they can shed more light on the issue, do let me know.

@jwbackhouse
Copy link
Author

jwbackhouse commented Jan 1, 2025

Thanks for the quick reply! I hadn't realised about the syntax highlighting difference, but can confirm the issue persists inside neovim (which is where I actually want to see them)

I'll mention it on their repo. I guess VS Code must use a different approach to recognising ligatures?

btw, it does look like the font has both calt and liga ligatures based on the README instructions for VSC setup:

calt: enables texture healing
liga: enables dynamic spacing for certain repeating character patterns like ///
ss01, ss02, etc: enables the specific stylistic set
cv30, cv60, etc: enables the specific character variants

@kovidgoyal
Copy link
Owner

kovidgoyal commented Jan 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants