Fix vertical character alignment in some cases
authorTon van den Heuvel <tonvandenheuvel@gmail.com>
Mon, 7 Mar 2016 21:18:12 +0000 (22:18 +0100)
committerChristoph Lohmann <20h@r-36.net>
Tue, 8 Mar 2016 14:43:52 +0000 (15:43 +0100)
The y-position of a character found by asking fontconfig for a matching
font does not take the border pixels into account, resulting in a
slightly misaligned vertical position.

Signed-off-by: Ton van den Heuvel <tonvandenheuvel@gmail.com>
Signed-off-by: Christoph Lohmann <20h@r-36.net>
st.c

diff --git a/st.c b/st.c
index ca126d7..f2b3095 100644 (file)
--- a/st.c
+++ b/st.c
@@ -3671,7 +3671,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
                specs[numspecs].font = frc[f].font;
                specs[numspecs].glyph = glyphidx;
                specs[numspecs].x = (short)xp;
-               specs[numspecs].y = (short)(winy + frc[f].font->ascent);
+               specs[numspecs].y = (short)yp;
                xp += runewidth;
                numspecs++;
        }