From 57c275468d505c7ab360a8dda9f131e73e15c941 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 17 May 2017 10:19:08 -0400 Subject: [PATCH] freetype appears to have changed some metrics i was relying on so now the fonts render weird. This fixes that but it needs more testing still --- inc/edit.h | 1 + lib/x11.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/edit.h b/inc/edit.h index 2967638..7a50175 100644 --- a/inc/edit.h +++ b/inc/edit.h @@ -213,6 +213,7 @@ enum { BufSize = 8192, /* default buffer size */ FontCacheSize = 16, /* Maximum number of fonts allowed in the font cache */ EventTimeout = 100, /* Maximum blocking wait time for events */ + LineSpacing = 2, /* Number of pixels for spacing between lines */ }; /* choose the font to use for xft */ diff --git a/lib/x11.c b/lib/x11.c index f0d97e1..aefb585 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -489,10 +489,10 @@ void x11_draw_glyphs(int fg, int bg, XGlyphSpec* specs, size_t nspecs) { XGlyphInfo extent; XftTextExtentsUtf8(X.display, font, (const FcChar8*)"0", 1, &extent); int w = extent.xOff; - int h = (font->height - font->descent); + int h = (font->height - font->descent) + LineSpacing; xftcolor(&bgc, Config->palette[bg]); size_t width = specs[nspecs-1].x - specs[0].x + w; - x11_draw_rect(bg, specs[0].x, specs[0].y - h, width, font->height); + x11_draw_rect(bg, specs[0].x, specs[0].y - h, width, font->height + LineSpacing); XftColorFree(X.display, X.visual, X.colormap, &bgc); } xftcolor(&fgc, Config->palette[fg]); -- 2.49.0