]> git.webhop.me Git - tuxwetter.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:16 +0000 (18:57 +0200)
committerJacek Jendrzej <satbaby@kawaii.com>
Wed, 12 Jul 2017 14:02:38 +0000 (16:02 +0200)
gfx.c
text.c
tuxwetter.c

diff --git a/gfx.c b/gfx.c
index 942f7709aca745bd83d9c0a807dbe88d18e33b9d..6cfdac73cc7962d83057634b2c141fe012624635 100644 (file)
--- a/gfx.c
+++ b/gfx.c
@@ -35,7 +35,7 @@ void RenderBox(int rsx, int rsy, int rex, int rey, int rad, int col)
        int dyy_max = var_screeninfo.yres;
        if (ssy + dyy > dyy_max)
        {
-               printf("[tuxwetter] %s called with max. width = %d (max. %d)\n", __func__, ssy + dyy, var_screeninfo.yres);
+               printf("[tuxwetter] %s called with height = %d (max. %d)\n", __func__, ssy + dyy, dyy_max);
                dyy = dyy_max - ssy;
        }
 
diff --git a/text.c b/text.c
index 66f9127fa100519ef5934317ca4dd6f8e795747f..e346cd38fb537f68e05d32abe37f2a18f5a91612 100644 (file)
--- a/text.c
+++ b/text.c
@@ -278,7 +278,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                if (_sx + sbit->xadvance >= _ex)
                        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);
@@ -290,8 +290,8 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                        for(pitch = 0; pitch < sbit->width; pitch++)
                        {
                                if (*s)
-                                               *q = colors[*s];
-                               q++, s++;
+                                       *q = colors[*s];
+                               q++; s++;
                                if (q > r)      /* we are past _ex */
                                        break;
                        }
index 349aa9a3229a3e00bff5a2e25c5455e50d0dce59..80ed5dd63214d42fc3fdfe0b0b8ac84cba2a6ba2 100644 (file)
@@ -44,7 +44,7 @@
 #include "gifdecomp.h"
 #include "icons.h"
 
-#define P_VERSION "4.02"
+#define P_VERSION "4.03"
 #define S_VERSION ""
 
 
@@ -1330,7 +1330,7 @@ char tun[2]="C",sun[5]="km/h",dun[6]="km",pun[5]="hPa",iun[7]="mm", cun[20];
        {
                RenderBox(wsx+6, wsy+6, wxw, wyw, radius, CSP0);
                RenderBox(wsx, wsy, wxw, wyw, radius, CMC);
-               RenderBox(wsx+2, wsy+2, wxw-4, 44, radius, CMH);
+               RenderBox(wsx, wsy, wxw, 44, radius, CMH);
        }
        else
        {
@@ -2590,7 +2590,7 @@ int pyw=ey-sy-((preset)?60:20);           //box height old 510
                        {
                                RenderBox(psx+6, psy+6, pxw, pyw, radius, CSP0);
                                RenderBox(psx, psy, pxw, pyw, radius, CMC);
-                               RenderBox(psx+2, psy+2, pxw-4, 44, radius, CMH);
+                               RenderBox(psx, psy, pxw, 44, radius, CMH);
                                RenderString(title, psx, psy+40, pxw, CENTER, FSIZE_BIG, CMHT);
 
                                if(!(rv=fh_php_load(name, col1, ssy, dy, cs, line, highlite, plain, &cut)))