From 53d8edf79ee1b0838d77ac83983b18295d016570 Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 11 Jul 2017 18:57:44 +0200 Subject: [PATCH] fix detect of bgcolor and thus also rendering of italic fonts --- gfx.c | 7 +++++++ input.c | 2 +- text.c | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gfx.c b/gfx.c index 1b99266..bb69a54 100644 --- 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 c144765..4e62c8f 100644 --- 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 c66ee66..7bf479c 100644 --- 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; } -- 2.39.5