arduinoprojects

git clone https://git.tarina.org/arduinoprojects
Log | Files | Refs

gfxfont.h (1108B)


      1 // Font structures for newer Adafruit_GFX (1.1 and later).
      2 // Example fonts are included in 'Fonts' directory.
      3 // To use a font in your Arduino sketch, #include the corresponding .h
      4 // file and pass address of GFXfont struct to setFont().  Pass NULL to
      5 // revert to 'classic' fixed-space bitmap font.
      6 
      7 #ifndef _GFXFONT_H_
      8 #define _GFXFONT_H_
      9 
     10 /// Font data stored PER GLYPH
     11 typedef struct {
     12   uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap
     13   uint8_t width;         ///< Bitmap dimensions in pixels
     14   uint8_t height;        ///< Bitmap dimensions in pixels
     15   uint8_t xAdvance;      ///< Distance to advance cursor (x axis)
     16   int8_t xOffset;        ///< X dist from cursor pos to UL corner
     17   int8_t yOffset;        ///< Y dist from cursor pos to UL corner
     18 } GFXglyph;
     19 
     20 /// Data stored for FONT AS A WHOLE
     21 typedef struct {
     22   uint8_t *bitmap;  ///< Glyph bitmaps, concatenated
     23   GFXglyph *glyph;  ///< Glyph array
     24   uint16_t first;   ///< ASCII extents (first char)
     25   uint16_t last;    ///< ASCII extents (last char)
     26   uint8_t yAdvance; ///< Newline distance (y axis)
     27 } GFXfont;
     28 
     29 #endif // _GFXFONT_H_