Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text vertical alignment is not static for chscale != 1.0 #96

Open
UtkarshVerma opened this issue Feb 12, 2023 · 2 comments
Open

Text vertical alignment is not static for chscale != 1.0 #96

UtkarshVerma opened this issue Feb 12, 2023 · 2 comments

Comments

@UtkarshVerma
Copy link
Contributor

I have noticed that commits bd37022 and a8e2af0 have caused misalignment of text vertically when chscale is not 1.0.

I believe it can be reproduced by enabling ligatures and setting chscale to 1.1. Here's a video showing the bug:

2023-02-12_13.57.33.mp4
@bakkeby
Copy link
Owner

bakkeby commented Feb 12, 2023

Hmm, if so then this should be reproducible with the latest ligatures patch on the suckless page and a chscale config change.

I wasn't directly able to reproduce this as I don't have that kind of command prediction / suggestion in place.

I grabbed a couple of frames from your video and placed them on top of each other in gimp. What I found was that the misalignment is exactly the that of the underline. So I was wondering didn't you expose a config option in your build to control the offset of that underline and could that be what is causing the misalignment here?

@UtkarshVerma
Copy link
Contributor Author

I created a branch on my fork for reproducing this with master.

https://github.com/UtkarshVerma/st-flexipatch/tree/alignment-bug

Here are the changes:

diff --git a/config.mk b/config.
index 36e98ce..dde2dc9 100644
--- a/config.mk
+++ b/config.mk
@@ -19,10 +19,10 @@ PKG_CONFIG =
 #XCURSOR = -lXcursor

 # Uncomment the lines below for
-#LIGATURES_C = hb.c
-#LIGATURES_H = hb.h
-#LIGATURES_INC = `$(PKG_CONFIG)
-#LIGATURES_LIBS = `$(PKG_CONFIG
+LIGATURES_C = hb.c
+LIGATURES_H = hb.h
+LIGATURES_INC = `$(PKG_CONFIG)
+LIGATURES_LIBS = `$(PKG_CONFIG)

 # Uncomment this for the SIXEL
 #SIXEL_C = sixel.c sixel_hls.c
~/.local/src/st alignment-bug !1 ❯ diff patches.def.h patches.h
228c228
< #define LIGATURES_PATCH 0
---
> #define LIGATURES_PATCH 1
375c375
< #define UNDERCURL_PATCH 0
---
> #define UNDERCURL_PATCH 1
400c400
< #define VERTCENTER_PATCH 0
---
> #define VERTCENTER_PATCH 1
448c448
< #define XRESOURCES_PATCH 0
---
> #define XRESOURCES_PATCH 1
~/.local/src/st alignment-bug !1 ❯ diff config.def.h config.h
64c64
< static float chscale = 1.0;
---
> static float chscale = 1.1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants