![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
dd
Dependencies: Final HCSR04 TB6612FNG
oled/gfxfont.h@97:b483e656bd14, 2019-06-16 (annotated)
- Committer:
- eunmango
- Date:
- Sun Jun 16 04:44:35 2019 +0000
- Revision:
- 97:b483e656bd14
t
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
eunmango | 97:b483e656bd14 | 1 | // Font structures for newer Adafruit_GFX (1.1 and later). |
eunmango | 97:b483e656bd14 | 2 | // Example fonts are included in 'Fonts' directory. |
eunmango | 97:b483e656bd14 | 3 | // To use a font in your Arduino sketch, #include the corresponding .h |
eunmango | 97:b483e656bd14 | 4 | // file and pass address of GFXfont struct to setFont(). Pass NULL to |
eunmango | 97:b483e656bd14 | 5 | // revert to 'classic' fixed-space bitmap font. |
eunmango | 97:b483e656bd14 | 6 | |
eunmango | 97:b483e656bd14 | 7 | #ifndef _GFXFONT_H_ |
eunmango | 97:b483e656bd14 | 8 | #define _GFXFONT_H_ |
eunmango | 97:b483e656bd14 | 9 | |
eunmango | 97:b483e656bd14 | 10 | #include <stdint.h> |
eunmango | 97:b483e656bd14 | 11 | |
eunmango | 97:b483e656bd14 | 12 | typedef struct { // Data stored PER GLYPH |
eunmango | 97:b483e656bd14 | 13 | uint16_t bitmapOffset; // Pointer into GFXfont->bitmap |
eunmango | 97:b483e656bd14 | 14 | uint8_t width, height; // Bitmap dimensions in pixels |
eunmango | 97:b483e656bd14 | 15 | uint8_t xAdvance; // Distance to advance cursor (x axis) |
eunmango | 97:b483e656bd14 | 16 | int8_t xOffset, yOffset; // Dist from cursor pos to UL corner |
eunmango | 97:b483e656bd14 | 17 | } GFXglyph; |
eunmango | 97:b483e656bd14 | 18 | |
eunmango | 97:b483e656bd14 | 19 | typedef struct { // Data stored for FONT AS A WHOLE: |
eunmango | 97:b483e656bd14 | 20 | uint8_t *bitmap; // Glyph bitmaps, concatenated |
eunmango | 97:b483e656bd14 | 21 | GFXglyph *glyph; // Glyph array |
eunmango | 97:b483e656bd14 | 22 | uint8_t first, last; // ASCII extents |
eunmango | 97:b483e656bd14 | 23 | uint8_t yAdvance; // Newline distance (y axis) |
eunmango | 97:b483e656bd14 | 24 | } GFXfont; |
eunmango | 97:b483e656bd14 | 25 | |
eunmango | 97:b483e656bd14 | 26 | #endif // _GFXFONT_H_ |