add support for fontconfig stylistic sets
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
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
Got it to work like this
font = wezterm.font_with_fallback {
{
family = "Maple Mono",
harfbuzz_features = { "ss01", "ss03", "ss04" },
},
"Symbols Nerd Font Mono"
},