cog1to / st-ligatures

Patches for ST (suckless terminal) that add support for ligatures drawing
54 stars 5 forks source link

Any ways to set font features. #16

Closed ghost closed 3 years ago

ghost commented 3 years ago

The title is clear, the patch is just amazing, especially since I love having lignatures, + the fact I am switching to neovim. One thing I want to ask is how can I set font features (ss01, calt, etc) because the font I use needs them for ligs to render properly

Edit: for some reason on all fonts I tested, those ligatures broke: =|| but =||= works 21-08-08_01h:34 21-08-08_01h:34 21-08-08_01h:33

cog1to commented 3 years ago

hello. thanks for the feedback. I didn't know about font features, but on the surface there seems to be a relatively easy way to add support for these via st's config. I'll try to work on that and update the patches

can you give me a font name or a link to the font that has this issue so I could test it?

ghost commented 3 years ago

The fonts I tested with

cog1to commented 3 years ago

hm, I got Cascadia Code Italic, but it seems to work fine on my end, even without font features:

cascadia-ligas

maybe there are some other patches interfering with the shaping/rendering. have you applied any other patches?

ghost commented 3 years ago

I have font2, scrollback, disable bold italics (these are the ones that may interfer) I will try a clean install with only the patch installed.

Edit: Weirdly enough, fira code don't have this issue with ligatures, guess i'll use it then. It might be cascadia code issue then.

Edit 2: The italics issue was font2 problem, fixed.

cog1to commented 3 years ago

@iRealistiX interesting. this might be a similar issue to the one I fixed earlier with boxdraw. I'll look into that more closely. Can you post the font2 config value you had?

ghost commented 3 years ago

@iRealistiX interesting. this might be a similar issue to the one I fixed earlier with boxdraw. I'll look into that more closely. Can you post the font2 config value you had?

It's not the font2 patch problem, it was me who (by hand) patched it the wrong way for another patch that is disable bold italic

TL;DR: I did a bad job at patching

cog1to commented 3 years ago

@iRealistiX Made a PR with font features support. It's a little clunky: you'll need to add them to the features array in hb.c after patching.

Would be cool if you can test it out before merge.

ghost commented 3 years ago

I'll test those out!

ghost commented 3 years ago

@cog1to, the new pr works real well, so I think this issue is now useless since my problem is fixed.