]> git.mdlowis.com Git - projs/tide.git/commitdiff
Tweaked font handling logic to allow drawing proportional fonts. Selection boxes...
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 12 Apr 2018 14:34:26 +0000 (10:34 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 12 Apr 2018 14:34:26 +0000 (10:34 -0400)
lib/config.c
lib/x11.c

index 8d4acc2cfb2bbef3f6d305c805011fff27873378..5994fb5161f47c3962dc2b070fc2df636ecd9ed9 100644 (file)
@@ -64,17 +64,17 @@ int Palette[ClrCount] = {
     [Purple]   = 0x000000, // Purple ???
     [Aqua]     = 0x000000, // Aqua   ???
     [Orange]   = 0x000000, // Orange ???
-    [EditBg]   = 0xefefda, // Edit region background
-    [EditSel]  = 0xdede8e, // Edit region selection
+    [EditBg]   = 0xF0F0E5, // Edit region background
+    [EditSel]  = 0xDFDF99, // Edit region selection
     [EditFg]   = 0x000000, // Edit region text
     [EditCsr]  = 0x000000, // Edit region cursor
-    [TagsBg]   = 0xdaefef, // Tags region background
-    [TagsSel]  = 0x8edede, // Tags region selection
+    [TagsBg]   = 0xE5F0F0, // Tags region background
+    [TagsSel]  = 0x99DFDF, // Tags region selection
     [TagsFg]   = 0x000000, // Tags region text
     [TagsCsr]  = 0x000000, // Tags region cursor
-    [ScrollBg] = 0x89893c, // Scroll region background
-    [ScrollFg] = 0xefefda, // Scroll region foreground
-    [VerBdr]   = 0x89893c, // Vertical border
+    [ScrollBg] = 0x909047, // Scroll region background
+    [ScrollFg] = 0xF0F0E5, // Scroll region foreground
+    [VerBdr]   = 0x909047, // Vertical border
     [HorBdr]   = 0x000000, // Horizontal border
 };
 #endif
index 45409a010df14d9f23321f641f200021a9c26c32..2f9955498e83449463ace506ea61f656ebc72295 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -696,9 +696,11 @@ static void draw_glyphs(size_t x, size_t y, UGlyph* glyphs, size_t rlen, size_t
             if (glyphs[i].rune == '\n')
                 glyphs[i].rune = ' ', eol = true;
             getglyph(CurrFont, &(specs[numspecs]), glyphs[i].rune);
+            XGlyphInfo extents;
+            XftTextExtents32(X.display, CurrFont->match, &(const FcChar32){glyphs[i].rune}, 1, &extents);
             specs[numspecs].x = x;
             specs[numspecs].y = y - x11_font_descent(CurrFont);
-            x += x11_font_width(CurrFont);
+            x += extents.xOff;
             numspecs++;
             i++;
             /* skip over null chars which mark multi column runes */