]> git.webhop.me Git - lcd4linux.git/commitdiff
scaletext patch from Stefan Kuhne
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 16 Jan 2012 02:50:03 +0000 (02:50 +0000)
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 16 Jan 2012 02:50:03 +0000 (02:50 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1170 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

drv_dpf.c
drv_generic_graphic.c

index a5d5c50d44d0a503fead4ca7d79e8b7917c6658b..39e1708f1fbe5ba5e17a5da4dce70df13fb3d66e 100644 (file)
--- a/drv_dpf.c
+++ b/drv_dpf.c
@@ -146,11 +146,23 @@ static int drv_dpf_start2(const char *section)
     }
 
     /* Fixme: provider other fonts someday... */
-    if (XRES != 6 && YRES != 8) {
+    /* Overridden - we have scaled the textout drawing */
+/*  if (XRES != 6 && YRES != 8) {
        error("%s: bad Font '%s' from %s (only 6x8 at the moment)", Name, s, cfg_source());
        return -1;
+    } */
+
+    /* we dont want fonts below 6 width */
+    if (XRES < 6) {
+       error("%s: bad Font '%s' width '%d' using minimum of 6)", Name, s, XRES);
+       XRES = 6;
     }
 
+    /* we dont want fonts below 8 height */
+    if (YRES < 8) {
+       error("%s: bad Font '%s' height '%d' using minimum of 8)", Name, s, YRES);
+       YRES = 8;
+    }
 
     /* open communication with the display */
     if (drv_dpf_open(section) < 0) {
index a8ac4d579ed97e32c9232760b8e3b29721442c7f..e05542d58700777c024cf831a02a2437076d76de 100644 (file)
@@ -267,10 +267,10 @@ static void drv_generic_graphic_render(const int layer, const int row, const int
        }
 
        for (y = 0; y < YRES; y++) {
-           int mask = 1 << XRES;
            for (x = 0; x < XRES; x++) {
-               mask >>= 1;
-               if (chr[y] & mask)
+               int mask = 1 << 6;
+               mask >>= ((x * 6) / (XRES)) + 1;
+               if (chr[(y * 8) / (YRES)] & mask)
                    drv_generic_graphic_FB[layer][(r + y) * LCOLS + c + x] = fg;
                else
                    drv_generic_graphic_FB[layer][(r + y) * LCOLS + c + x] = bg;