diff options
author | Andrew Hannam <andrewh@inmarket.com.au> | 2012-08-04 14:30:40 +1000 |
---|---|---|
committer | Andrew Hannam <andrewh@inmarket.com.au> | 2012-08-04 14:30:40 +1000 |
commit | c4f5dedfb8939b50405e8197f372e814ede8d06b (patch) | |
tree | c138286566afbf2b9799abde6a38f769a925892a /halext/include/gdisp_fonts.h | |
parent | 90e67da66efee1e9957016356bfd962bd50f8c64 (diff) | |
download | uGFX-c4f5dedfb8939b50405e8197f372e814ede8d06b.tar.gz uGFX-c4f5dedfb8939b50405e8197f372e814ede8d06b.tar.bz2 uGFX-c4f5dedfb8939b50405e8197f372e814ede8d06b.zip |
Incorporate Abhishek's changes
His font support was better than mine.
Diffstat (limited to 'halext/include/gdisp_fonts.h')
-rw-r--r-- | halext/include/gdisp_fonts.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/halext/include/gdisp_fonts.h b/halext/include/gdisp_fonts.h index f22e75df..2f573344 100644 --- a/halext/include/gdisp_fonts.h +++ b/halext/include/gdisp_fonts.h @@ -54,8 +54,6 @@ #error "GDISP: GDISP_MAX_FONT_HEIGHT must be either 16 or 32"
#endif
-typedef const fontcolumn_t * const pfontcolumn_t;
-
/**
* @brief Internal font structure.
* @note This structure is followed by:
@@ -74,15 +72,17 @@ struct font { uint8_t maxWidth;
char minChar;
char maxChar;
- const uint8_t * const widthTable;
- const fontcolumn_t * const (* const offsetTable);
+ const uint8_t *widthTable;
+ const uint16_t *offsetTable;
+ const fontcolumn_t *dataTable;
};
/**
* @brief Macro's to get to the complex parts of the font structure.
*/
-#define _getCharWidth(f,c) (((c) < (f)->minChar || (c) > (f)->maxChar) ? 0 : (f)->widthTable[c - (f)->minChar])
-#define _getCharData(f,c) (f)->offsetTable[c - (f)->minChar]
+#define _getCharWidth(f,c) (((c) < (f)->minChar || (c) > (f)->maxChar) ? 0 : (f)->widthTable[(c) - (f)->minChar])
+#define _getCharOffset(f,c) ((f)->offsetTable[(c) - (f)->minChar])
+#define _getCharData(f,c) (&(f)->dataTable[_getCharOffset(f, c)])
#endif /* _GDISP_FONTS_H */
/** @} */
|