KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
153:8a85efb3eb71
Parent:
152:a013ac0133e4
Child:
162:a2d7f1988711
--- a/GraphicsDisplay.cpp	Mon Nov 06 01:41:55 2017 +0000
+++ b/GraphicsDisplay.cpp	Sun Jul 29 00:32:51 2018 +0000
@@ -3,6 +3,8 @@
  * Released under the MIT License: http://mbed.org/license/mit
  *
  * Derivative work by D.Smart 2014
+ * 201807 Scalable soft-fonts and gif support
+ *
  */
 
 #include "GraphicsDisplay.h"
@@ -181,7 +183,6 @@
         _putp(color[i]);
     }
     _EndGraphicsStream();
-    //return WindowMax();
     return window(restore);
 }
 
@@ -229,18 +230,13 @@
 
 int GraphicsDisplay::fontblit(loc_t x, loc_t y, const unsigned char c)
 {
-    const uint8_t * charRecord;   // width, data, data, data, ...
-    dim_t charWidth, charHeight;
+    const uint8_t * charRecord;         // pointer to char data; width, data, data, data, ...
+    dim_t charWidth, charHeight;        // metrics for the raw char in the font table
     charRecord = getCharMetrics(c, &charWidth, &charHeight);
     if (charRecord) {
         INFO("hgt:%d, wdt:%d", charHeight, charWidth);
-        // clip to the edge of the screen
-        //if (x + charWidth >= width())
-        //    charWidth = width() - x;
-        //if (y + charHeight >= height())
-        //    charHeight = height() - y;
         booleanStream(x,y,charWidth, charHeight, charRecord);
-        return charWidth;
+        return charWidth * fontScaleX;
     } else {
         return 0;
     }