KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
98:ecebed9b80b2
Parent:
95:ef538bd687c0
Child:
100:0b084475d5a9
--- a/GraphicsDisplay.h	Sat Nov 28 15:39:44 2015 +0000
+++ b/GraphicsDisplay.h	Thu Dec 17 12:16:40 2015 +0000
@@ -16,13 +16,6 @@
 #include "Bitmap.h"
 #include "TextDisplay.h"
 
-// GraphicsDisplay has one "soft font" which is in a different format
-// then the primary font rendering api - see set_font(...). This is
-// therefore deprecated, but preserved for a time for backward 
-// compatibility.
-// #define LOCALFONT
-
-
 /// The GraphicsDisplay class 
 /// 
 /// This graphics display class supports both graphics and text operations.
@@ -209,10 +202,11 @@
     /// @param[in] x is the horizontal pixel coordinate
     /// @param[in] y is the vertical pixel coordinate
     /// @param[in] fontTable is the base of the table which has the metrics
-    /// @param[in] fontChar is the start of that record in the table for the char (e.g. 'A' - 'Z')
-    /// @returns how far the cursor should advance to the right in pixels
+    /// @param[in] c is the character to render
+    /// @returns how far the cursor should advance to the right in pixels.
+    /// @returns zero if the character could not be rendered.
     ///
-    virtual int fontblit(int x, int y, const unsigned char * fontTable, const unsigned char * fontChar);
+    virtual int fontblit(int x, int y, const unsigned char * fontTable, const unsigned char c);
     
     /// This method returns the color value from a palette.
     ///
@@ -339,32 +333,42 @@
     ///    
     virtual int rows(void);
     
-    /// Select a bitmap font (provided by the user) for all subsequent text
-    /// rendering.
+    /// Select a bitmap font (provided by the user) for all subsequent text.
     ///
-    /// This API permits selection of a special memory mapped font, which 
-    /// enables the presentation of many font sizes and styles, including
-    /// proportional fonts.
+    /// @caution This function is deprecated. @see SelectUserFont.
     ///
     /// @note Tool to create the fonts is accessible from its creator
-    ///     available at http://www.mikroe.com.
-    ///     Hint: Change the data to an array of type char[].
+    ///     available at http://www.mikroe.com. 
+    ///     Change the data to an array of type char[].
     ///
-    ///     This special font array has a 4-byte header, followed by 
-    ///     the data:
-    ///   \li the number of bytes per char
-    ///   \li the vertical size in pixels for each character
-    ///   \li the horizontal size in pixels for each character
-    ///   \li the number of bytes per vertical line (width of the array)
-    ///   \li the subsequent records are the font information.
+    /// This special font array is modified from the mikroe tool output,
+    /// to include a special 4-byte header, which has this data:
+    ///   - the number of bytes per char
+    ///   - the vertical size in pixels for each character
+    ///   - the horizontal size in pixels for each character
+    ///   - the number of bytes per vertical line (width of the array)
+    ///   - following this special header is the normal data stream.
     ///
-    /// @param[in] font is a pointer to a specially formed font array. 
-    ///     NULL, or the omission of this parameter will restore the default
-    ///     font capability, which may use the display controllers hardware
-    ///     font (if available), or no font.
+    /// @param[in] font is a pointer to a specially formed font array.
     /// @returns error code.
     ///
     virtual RetCode_t set_font(const unsigned char * font = NULL);
+    
+    
+    /// Select a User Font for all subsequent text.
+    ///
+    /// @note This function is replaces the obsolete function @see set_font.
+    ///
+    /// @note Tool to create the fonts is accessible from its creator
+    ///     available at http://www.mikroe.com. 
+    ///     For version 1.2.0.0, choose the "Export for TFT and new GLCD"
+    ///     format.
+    ///
+    /// @param[in] font is a pointer to a specially formed font resource.
+    /// @returns error code.
+    ///
+    virtual RetCode_t SelectUserFont(const uint8_t * font = NULL);
+
 
 protected:
 
@@ -407,10 +411,6 @@
     ///
     RetCode_t _RenderBitmap(loc_t x, loc_t y, uint32_t fileOffset, FILE * Image);
 
-    #ifdef LOCALFONT
-    virtual int blitbit(int x, int y, int w, int h, const char * color);
-    #endif
-    
     const unsigned char * font;     ///< reference to an external font somewhere in memory
     
     // pixel location