wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

add support for fontconfig stylistic sets

Open Roger-Roger-debug opened this issue 1 year ago • 2 comments

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

Hyprland

WezTerm version

wezterm 20240128-202157-1e552d76-gentoo

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

I have enabled stylistic style sets for my font like this

<match target="font">
    <test name="fontformat" compare="not_eq">
      <string />
    </test>
    <test name="family">
      <string>MapleMono Nerd Font</string>
    </test>
    <edit name="fontfeatures" mode="assign_replace">
      <string>ss01</string>
      <string>ss03</string>
      <string>ss04</string>
    </edit>
  </match>

I can see it working in Firefox, but wezterm seems to ignore the settings and I need to define it again for wezterm specifically.

To Reproduce

  • Have a font with ss
  • Enable them in .config/fontconfig/fonts.conf like above
  • Try to use them in wezterm

Configuration

local wezterm = require 'wezterm';

return {
	font = wezterm.font("monospace"),
	font_size = 18,
}

Expected Behavior

Wezterm uses the same stylistic sets without needing to be configured separately.

Logs

No response

Anything else?

No response

Roger-Roger-debug avatar Feb 06 '24 13:02 Roger-Roger-debug

This isn't a bug, but an aspect of being a cross-platform application; out of all the systems that wezterm runs on, only fontconfig works this way.

The supported way to enable stylistic sets today is via https://wezfurlong.org/wezterm/config/font-shaping.html

wez avatar Feb 06 '24 14:02 wez

Got it to work like this

	font = wezterm.font_with_fallback {
		{
			family = "Maple Mono",
			harfbuzz_features = { "ss01", "ss03", "ss04" },
		},
		"Symbols Nerd Font Mono"
	},

Roger-Roger-debug avatar Feb 06 '24 14:02 Roger-Roger-debug