]> git.mdlowis.com Git - projs/tide.git/commitdiff
freetype appears to have changed some metrics i was relying on so now the fonts rende...
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 17 May 2017 14:19:08 +0000 (10:19 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 17 May 2017 14:19:08 +0000 (10:19 -0400)
inc/edit.h
lib/x11.c

index 29676382ef9917a8d204866a404d3d9a3677e2e7..7a501758f90889238a4593461331c7b1738d3003 100644 (file)
@@ -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 */
index f0d97e15e5ec225c3cb72075ae019893829fc058..aefb585233c5589828f0f10c56f757c56a981b4d 100644 (file)
--- 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]);