Fork of the latest Adafruit GFX Library as of 2017-12-13 to make it compatible with Mbed
gfxfont.h@0:cc4253367fc7, 2017-12-13 (annotated)
- Committer:
- mjromeijn
- Date:
- Wed Dec 13 20:24:59 2017 +0000
- Revision:
- 0:cc4253367fc7
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mjromeijn | 0:cc4253367fc7 | 1 | // Font structures for newer Adafruit_GFX (1.1 and later). |
mjromeijn | 0:cc4253367fc7 | 2 | // Example fonts are included in 'Fonts' directory. |
mjromeijn | 0:cc4253367fc7 | 3 | // To use a font in your Arduino sketch, #include the corresponding .h |
mjromeijn | 0:cc4253367fc7 | 4 | // file and pass address of GFXfont struct to setFont(). Pass NULL to |
mjromeijn | 0:cc4253367fc7 | 5 | // revert to 'classic' fixed-space bitmap font. |
mjromeijn | 0:cc4253367fc7 | 6 | |
mjromeijn | 0:cc4253367fc7 | 7 | #ifndef _GFXFONT_H_ |
mjromeijn | 0:cc4253367fc7 | 8 | #define _GFXFONT_H_ |
mjromeijn | 0:cc4253367fc7 | 9 | |
mjromeijn | 0:cc4253367fc7 | 10 | typedef struct { // Data stored PER GLYPH |
mjromeijn | 0:cc4253367fc7 | 11 | uint16_t bitmapOffset; // Pointer into GFXfont->bitmap |
mjromeijn | 0:cc4253367fc7 | 12 | uint8_t width, height; // Bitmap dimensions in pixels |
mjromeijn | 0:cc4253367fc7 | 13 | uint8_t xAdvance; // Distance to advance cursor (x axis) |
mjromeijn | 0:cc4253367fc7 | 14 | int8_t xOffset, yOffset; // Dist from cursor pos to UL corner |
mjromeijn | 0:cc4253367fc7 | 15 | } GFXglyph; |
mjromeijn | 0:cc4253367fc7 | 16 | |
mjromeijn | 0:cc4253367fc7 | 17 | typedef struct { // Data stored for FONT AS A WHOLE: |
mjromeijn | 0:cc4253367fc7 | 18 | uint8_t *bitmap; // Glyph bitmaps, concatenated |
mjromeijn | 0:cc4253367fc7 | 19 | GFXglyph *glyph; // Glyph array |
mjromeijn | 0:cc4253367fc7 | 20 | uint8_t first, last; // ASCII extents |
mjromeijn | 0:cc4253367fc7 | 21 | uint8_t yAdvance; // Newline distance (y axis) |
mjromeijn | 0:cc4253367fc7 | 22 | } GFXfont; |
mjromeijn | 0:cc4253367fc7 | 23 | |
mjromeijn | 0:cc4253367fc7 | 24 | #endif // _GFXFONT_H_ |