]> git.webhop.me Git - input.git/commitdiff
fix detect of bgcolor and thus also rendering of italic fonts
authorGetAway <get-away@t-online.de>
Tue, 11 Jul 2017 16:57:44 +0000 (18:57 +0200)
committerJacek Jendrzej <satbaby@kawaii.com>
Wed, 12 Jul 2017 14:00:52 +0000 (16:00 +0200)
gfx.c
input.c
text.c

diff --git a/gfx.c b/gfx.c
index 1b99266d370ba0b6b3f4411c8accabc835a772b2..bb69a546a5ab03e89caffc999838e0a755bff6fa 100644 (file)
--- a/gfx.c
+++ b/gfx.c
@@ -23,6 +23,13 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
                dxx=0;
        }
 
+       int dyy_max = var_screeninfo.yres;
+       if (ssy + dyy > dyy_max)
+       {
+               printf("[%s] %s called with height = %d (max. %d)\n", __plugin__, __func__, ssy + dyy, dyy_max);
+               dyy = dyy_max - ssy;
+       }
+
        if(R)
        {
                if(--dyy<=0)
diff --git a/input.c b/input.c
index c1447650e0b5d45bd40648e3769a232de1eddee9..4e62c8fcc9dc5513c9f8cd2a4b3d9cc7d66e86dd 100644 (file)
--- a/input.c
+++ b/input.c
@@ -12,7 +12,7 @@
 
 #define NCF_FILE       "/var/tuxbox/config/neutrino.conf"
 #define BUFSIZE        1024
-#define I_VERSION      2.02
+#define I_VERSION      2.03
 
 
 char FONT[128]="/share/fonts/neutrino.ttf";
diff --git a/text.c b/text.c
index c66ee66dfda36837cd7392ff1e660b58275d9358..7bf479c62ecea527d20af3a3368e2067e86afaf6 100644 (file)
--- a/text.c
+++ b/text.c
@@ -149,7 +149,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
        {
                if (_sx + sbit->xadvance > _ex + 5)
                        return -1; /* limit to maxwidth */
-               uint32_t bgcolor = *(lbb + (sy + _sy - sbit->top) * stride + (sx + _sx));
+               uint32_t bgcolor = *(lbb + (sy + _sy - _d - 1) * stride + (sx + _sx + sbit->left));
                uint32_t fgcolor = bgra[color];
                uint32_t *colors = lookup_colors(fgcolor, bgcolor);
                uint32_t *p = lbb + (sx + _sx + sbit->left + kerning.x) + stride * (sy + _sy - sbit->top - _d);
@@ -162,7 +162,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                        {
                                if (*s)
                                        *q = colors[*s];
-                               q++, s++;
+                               q++; s++;
                                if (q > r)      /* we are past _ex */
                                        break;
                        }