Closed AndydeCleyre closed 10 months ago
You can run wezterm ls-fonts --text "something"
to have wezterm explain the shaping plan for a snippet of text.
I would suggest pasting in the sequence that isn't shaping as you expect there and sharing what you see.
$ wezterm ls-fonts --text '</' # expect lig, but get no lig
LeftToRight
0 < \u{3c} x_adv=16 cells=1 glyph=31 wezterm.font("Iosevka Term Custom", {weight="Regular", stretch="Normal", style="Normal"})
/home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf, FontConfig
1 / \u{2f} x_adv=16 cells=1 glyph=12238 wezterm.font("Iosevka Term Custom", {weight="Regular", stretch="Normal", style="Normal"})
/home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf, FontConfig
$ wezterm ls-fonts --text '<>' # expect lig, indeed get lig
LeftToRight
0 < \u{3c} x_adv=16 cells=1 glyph=13418 wezterm.font("Iosevka Term Custom", {weight="Regular", stretch="Normal", style="Normal"})
/home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf, FontConfig
1 > \u{3e} x_adv=16 cells=1 glyph=13419 wezterm.font("Iosevka Term Custom", {weight="Regular", stretch="Normal", style="Normal"})
/home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf, FontConfig
$ wezterm ls-fonts --text '/=' # expect no lig, indeed get no lig
LeftToRight
0 / \u{2f} x_adv=16 cells=1 glyph=12238 wezterm.font("Iosevka Term Custom", {weight="Regular", stretch="Normal", style="Normal"})
/home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf, FontConfig
1 = \u{3d} x_adv=16 cells=1 glyph=32 wezterm.font("Iosevka Term Custom", {weight="Regular", stretch="Normal", style="Normal"})
/home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf, FontConfig
The harfbuzz_features
setting in your config may be disabling some of the default ligature related options.
The default value is harfbuzz_features = { 'kern', 'liga', 'clig'}
So I'd suggest setting:
harfbuzz_features = { 'kern', 'liga', 'clig', 'thnd', 'frac', 'txtr' }
otherwise: wezterm is just using what harfbuzz decides. You may also wish to try using its utilities directly to compare:
$ hb-shape /home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf -u 3c,2f
This will render an image directly to the terminal:
$ hb-view /home/andy/.local/share/fonts/IosevkaTermCustom-Regular.ttf -u 3c,2f
Thanks! The hb-view
command does use the ligature.
I didn't realize I was removing harfbuzz options by adding them there, whoops!
Using
harfbuzz_features = { 'kern', 'liga', 'clig', 'thnd', 'frac', 'txtr' }
also does not result in those particular ligatures being used, but removing the line altogether does end up rendering them as ligatures.
Ah, it seems it's frac
is incompatible with those slash-y ligatures. I don't know if that's a general thing, or with this font in particular or what.
Glad you figured this out! I'm going to close this because it is not a wezterm issue.
Thanks again for the help. I do think the current text at your font shaping docs is misleading, as it for example suggests:
config.harfbuzz_features = { 'zero' }
without any indication that this is destructive of some default and unrelated values.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
What Operating System(s) are you seeing this problem on?
Linux X11
Which Wayland compositor or X11 Window manager(s) are you using?
Plasma/KWin (X11)
WezTerm version
20231203-124028-e3cd2e93
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
Just a handful of Iosevka's ligatures/ligations don't seem to render as such, using a build of Iosevka which has
dlig
set as the default. The specific build I'm testing is here: Iosevka Term Custom.Here's a screenshot of the same tmux session rendered with Konsole (top) and Wezterm (bottom). The blue items are not expected to be rendered as ligatures, and are fine. The majority of ligatures are also fine. The red items are expected to be rendered as ligatures and do so in Konsole (and Firefox and Sublime Text), but not Wezterm.
To Reproduce
Zsh:
Configuration
Expected Behavior
I would expect the following to be rendered in ligature form:
</
</>
/>
/*
*/
\/
/\
Logs
No response
Anything else?
No response