sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit ead8e31902cab38938cc5367ef12c03c52371c11
parent eb95249f1fbe9084d7310c98d4e39c0430a55f93
Author: Doug Whiteley <dougwhiteley@gmail.com>
Date:   Fri, 19 Aug 2016 10:59:42 +0100

Add vertcenter st patch

Diffstat:
Ast.suckless.org/patches/st-vertcenter-0.7.diff | 42++++++++++++++++++++++++++++++++++++++++++
Ast.suckless.org/patches/st-vertcenter-20160819-023225e.diff | 44++++++++++++++++++++++++++++++++++++++++++++
Ast.suckless.org/patches/st-vertcenter-after-s.png | 0
Ast.suckless.org/patches/st-vertcenter-after.png | 0
Ast.suckless.org/patches/st-vertcenter-before-s.png | 0
Ast.suckless.org/patches/st-vertcenter-before.png | 0
Ast.suckless.org/patches/vertcenter.md | 25+++++++++++++++++++++++++
7 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/st-vertcenter-0.7.diff b/st.suckless.org/patches/st-vertcenter-0.7.diff @@ -0,0 +1,42 @@ +--- a/st.c ++++ b/st.c +@@ -268,6 +268,7 @@ typedef struct { + int w, h; /* window width and height */ + int ch; /* char height */ + int cw; /* char width */ ++ int cyo; /* char y offset */ + char state; /* focus, redraw, visible */ + int cursor; /* cursor style */ + } XWindow; +@@ -3359,6 +3360,7 @@ xloadfonts(char *fontstr, double fontsize) + /* Setting character width and height. */ + xw.cw = ceilf(dc.font.width * cwscale); + xw.ch = ceilf(dc.font.height * chscale); ++ xw.cyo = ceilf(dc.font.height * (chscale - 1) / 2); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); +@@ -3584,7 +3586,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 + xw.cyo; + } + + /* Lookup character index with default font. */ +@@ -3796,12 +3798,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 + 1, ++ XftDrawRect(xw.draw, fg, winx, winy + xw.cyo + dc.font.ascent + 1, + width, 1); + } + + if (base.mode & ATTR_STRUCK) { +- XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3, ++ XftDrawRect(xw.draw, fg, winx, winy + xw.cyo + 2 * dc.font.ascent / 3, + width, 1); + } + diff --git a/st.suckless.org/patches/st-vertcenter-20160819-023225e.diff b/st.suckless.org/patches/st-vertcenter-20160819-023225e.diff @@ -0,0 +1,44 @@ +diff --git a/st.c b/st.c +index 2594c65..7285237 100644 +--- a/st.c ++++ b/st.c +@@ -268,6 +268,7 @@ typedef struct { + int w, h; /* window width and height */ + int ch; /* char height */ + int cw; /* char width */ ++ int cyo; /* char y offset */ + char state; /* focus, redraw, visible */ + int cursor; /* cursor style */ + } XWindow; +@@ -3359,6 +3360,7 @@ xloadfonts(char *fontstr, double fontsize) + /* Setting character width and height. */ + xw.cw = ceilf(dc.font.width * cwscale); + xw.ch = ceilf(dc.font.height * chscale); ++ xw.cyo = ceilf(dc.font.height * (chscale - 1) / 2); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); +@@ -3584,7 +3586,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 + xw.cyo; + } + + /* Lookup character index with default font. */ +@@ -3796,12 +3798,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 + 1, ++ XftDrawRect(xw.draw, fg, winx, winy + xw.cyo + dc.font.ascent + 1, + width, 1); + } + + if (base.mode & ATTR_STRUCK) { +- XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3, ++ XftDrawRect(xw.draw, fg, winx, winy + xw.cyo + 2 * dc.font.ascent / 3, + width, 1); + } + diff --git a/st.suckless.org/patches/st-vertcenter-after-s.png b/st.suckless.org/patches/st-vertcenter-after-s.png Binary files differ. diff --git a/st.suckless.org/patches/st-vertcenter-after.png b/st.suckless.org/patches/st-vertcenter-after.png Binary files differ. diff --git a/st.suckless.org/patches/st-vertcenter-before-s.png b/st.suckless.org/patches/st-vertcenter-before-s.png Binary files differ. diff --git a/st.suckless.org/patches/st-vertcenter-before.png b/st.suckless.org/patches/st-vertcenter-before.png Binary files differ. diff --git a/st.suckless.org/patches/vertcenter.md b/st.suckless.org/patches/vertcenter.md @@ -0,0 +1,25 @@ +vertcenter +========== + +Description +----------- + +Vertically center lines in the space available if you have set a larger +chscale in config.h. + +Before: +->[![Before](st-vertcenter-before-s.png)](st-vertcenter-before.png)<- + +After: +->[![After](st-vertcenter-after-s.png)](st-vertcenter-after.png)<- + +Download +-------- + + * [st-vertcenter-0.7.diff](st-vertcenter-0.7.diff) + * [st-vertcenter-20160819-023225e.diff](st-vertcenter-20160819-023225e.diff) + +Authors +------- + + * Doug Whiteley - <dougwhiteley@gmail.com>