[wiki] [sites] [st][patch][vertcenter] updated the patch to master || roket1428

From: <git_AT_suckless.org>
Date: Tue, 03 Oct 2023 10:54:56 +0200

commit 0f586c99875a21b1a8b4a13aa78878bcd3a20637
Author: roket1428 <meorhan_AT_protonmail.com>
Date: Tue Oct 3 11:33:07 2023 +0300

    [st][patch][vertcenter] updated the patch to master
    
    After the commit 2aefa34 patch needed to be applied manually, so I updated it.

diff --git a/st.suckless.org/patches/vertcenter/index.md b/st.suckless.org/patches/vertcenter/index.md
index c716b409..7f90397d 100644
--- a/st.suckless.org/patches/vertcenter/index.md
+++ b/st.suckless.org/patches/vertcenter/index.md
_AT_@ -21,6 +21,7 @@ Download
 * [st-vertcenter-20170601-5a10aca.diff](st-vertcenter-20170601-5a10aca.diff)
 * [st-vertcenter-20171207-0ac685f.diff](st-vertcenter-20171207-0ac685f.diff)
 * [st-vertcenter-20180320-6ac8c8a.diff](st-vertcenter-20180320-6ac8c8a.diff)
+* [st-vertcenter-20231003-eb3b894.diff](st-vertcenter-20231003-eb3b894.diff)
 
 Authors
 --------
diff --git a/st.suckless.org/patches/vertcenter/st-vertcenter-20231003-eb3b894.diff b/st.suckless.org/patches/vertcenter/st-vertcenter-20231003-eb3b894.diff
new file mode 100644
index 00000000..f2d08a2b
--- /dev/null
+++ b/st.suckless.org/patches/vertcenter/st-vertcenter-20231003-eb3b894.diff
_AT_@ -0,0 +1,65 @@
+From c85891b21261b68b09ed9ae6a1ca18655ef19e69 Mon Sep 17 00:00:00 2001
+From: roket1428 <meorhan_AT_protonmail.com>
+Date: Tue, 3 Oct 2023 11:10:39 +0300
+Subject: [PATCH] vertcenter patch
+
+---
+ x.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/x.c b/x.c
+index aa09997..9ecb46e 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -83,6 +83,7 @@ typedef struct {
+ int w, h; /* window width and height */
+ int ch; /* char height */
+ int cw; /* char width */
++ int cyo; /* char y offset */
+ int mode; /* window state/mode flags */
+ int cursor; /* cursor style */
+ } TermWindow;
+_AT_@ -1031,6 +1032,7 @@ xloadfonts(const char *fontstr, double fontsize)
+ /* Setting character width and height. */
+ win.cw = ceilf(dc.font.width * cwscale);
+ win.ch = ceilf(dc.font.height * chscale);
++ win.cyo = ceilf(dc.font.height * (chscale - 1) / 2);
+
+ FcPatternDel(pattern, FC_SLANT);
+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+_AT_@ -1255,7 +1257,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
+ FcCharSet *fccharset;
+ int i, f, numspecs = 0;
+
+- for (i = 0, xp = winx, yp = winy + font->ascent; i < len; ++i) {
++ for (i = 0, xp = winx, yp = winy + font->ascent + win.cyo; i < len; ++i) {
+ /* Fetch rune and mode for current glyph. */
+ rune = glyphs[i].u;
+ mode = glyphs[i].mode;
+_AT_@ -1280,7 +1282,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
+ font = &dc.bfont;
+ frcflags = FRC_BOLD;
+ }
+- yp = winy + font->ascent;
++ yp = winy + font->ascent + win.cyo;
+ }
+
+ /* Lookup character index with default font. */
+_AT_@ -1493,12 +1495,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
+
+ /* Render underline and strikethrough. */
+ if (base.mode & ATTR_UNDERLINE) {
+- XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent * chscale + 1,
++ XftDrawRect(xw.draw, fg, winx, winy + win.cyo + dc.font.ascent * chscale + 1,
+ width, 1);
+ }
+
+ if (base.mode & ATTR_STRUCK) {
+- XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent * chscale / 3,
++ XftDrawRect(xw.draw, fg, winx, winy + win.cyo + 2 * dc.font.ascent * chscale / 3,
+ width, 1);
+ }
+
+--
+2.42.0
+
Received on Tue Oct 03 2023 - 10:54:56 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 03 2023 - 11:00:50 CEST