bakkeby / st-flexipatch

An st build with preprocessor directives to decide which patches to include during build time
MIT License
361 stars 108 forks source link

WIDE_GLYPH_SPACING_PATCH doesn't work properly #26

Closed enesdogan00 closed 3 years ago

enesdogan00 commented 3 years ago

When I set WIDE_GLYPH_SPACING_PATCH to 1 all characters intersect as it's shown on the screenshot below.

2021-05-14_15-13

bakkeby commented 3 years ago

It probably doesn't work that well when fallback fonts are used. What font do you use with st?

bakkeby commented 3 years ago

The only other alternative is to try and manually hack the Xft library ref. https://github.com/googlefonts/Inconsolata/issues/42#issuecomment-791452847

enesdogan00 commented 3 years ago

sed. What font do you use with

static char *font = "Mono:pixelsize=20:antialias=true:autohint=true";

that'a the config line for fonts

bakkeby commented 3 years ago

I guess the behaviour you are seeing is expected then.

The WIDE_GLYPH_SPACING_PATCH is a specific workaround for Inconsolata v3.000, one of Google's Variable Fonts (VF), where the letter spacing is too wide when rendered via the Xft library, see: https://github.com/googlefonts/Inconsolata/issues/42

The workaround artificially makes the spacing a third of what Xft says it is.

Perhaps you were looking for the WIDE_GLYPHS_PATCH that adds support for wide icons ref. https://www.reddit.com/r/suckless/comments/jt90ai/update_support_for_proper_glyph_rendering_in_st/

enesdogan00 commented 3 years ago

I guess the behaviour you are seeing is expected then.

The WIDE_GLYPH_SPACING_PATCH is a specific workaround for Inconsolata v3.000, one of Google's Variable Fonts (VF), where the letter spacing is too wide when rendered via the Xft library, see: googlefonts/Inconsolata#42

The workaround artificially makes the spacing a third of what Xft says it is.

Perhaps you were looking for the WIDE_GLYPHS_PATCH that adds support for wide icons ref. https://www.reddit.com/r/suckless/comments/jt90ai/update_support_for_proper_glyph_rendering_in_st/

I've eneabled that but icons still aren't renderd normally

bakkeby commented 3 years ago

Have you disabled WIDE_GLYPH_SPACING_PATCH?

enesdogan00 commented 3 years ago

Have you disabled WIDE_GLYPH_SPACING_PATCH?

Yes I've

bakkeby commented 3 years ago

Are you sure that you have a font that is named just "Mono"?

You can check what fonts you have using fc-list.

Otherwise it will fall back to using something from system configuration, possibly /etc/fonts/fonts.conf.

enesdogan00 commented 3 years ago

I've tried many fonts (some monospaced some not) still doesn't work.

bakkeby commented 3 years ago

What exactly doesn't work? Have you tried a bare st from https://st.suckless.org/?

enesdogan00 commented 3 years ago

Yes I tried that ass well but icons look like this.

2021-05-14_13-58

They are cropped

bakkeby commented 3 years ago

The screenshot is the same as in the reddit post. What is this terminal application? The original patch assumed that the boxdraw patch is included, but quite strictly it shouldn't be necessary. You can of course try and enable BOXDRAW_PATCH to see if it makes any difference.

enesdogan00 commented 3 years ago

I enabled the patch but still no change. Terminal app is nnn with icon flag enabled. If you're on an Arch based system package name is nnn-icons on AUR.

bakkeby commented 3 years ago

OK, so I did a git clone of st-flexipatch, compiled and, ran st, started nnn and I get image

Showing cut-off icons as in your example. Enabling WIDE_GLYPHS_PATCH did not make any difference.

The patch worked fine for lsd for example when I originally tested this, but it clearly does not work for nnn in this case.

After some digging I found that the patch also relies on these changes, although it is not clear why exactly.

https://github.com/LukeSmithxyz/st/pull/224/commits/ca42c0cc02f0a11e8171f1dfda1a916139e3de01

I have integrated the above into the wide glyphs patch, can you give it another go and see if it works correctly for you now?

According to https://github.com/LukeSmithxyz/st/pull/224#issuecomment-674060073 there is also an issue where the wide glyphs patch can leave remnant data in the undrawable area when the anysize patch is used, possibly this could be solved by using a smaller font size for the fallback emoji font.

enesdogan00 commented 3 years ago

Thans for your efforts but it didn't work. I cloned the repo from scratch and enabled WIDE_GLYPHS_PATCH. I'm going to find something and create a pull request for that.

bakkeby commented 3 years ago

It displays like this for me now: image

You may try and see if Luke Smith's build shows correctly for you (for me no icons showed up, but I suspect that would be due to a fonts issue).

enesdogan00 commented 3 years ago

It displays like this for me now: image

You may try and see if Luke Smith's build shows correctly for you (for me no icons showed up, but I suspect that would be due to a fonts issue).

Alright thanks for the help