keycard-pro/app/font/font.h

32 lines
988 B
C
Raw Normal View History

2023-04-04 14:34:35 +00:00
// Font structures from Adafruit_GFX (1.1 and later).
#ifndef _FONT_H_
#define _FONT_H_
#include <stdint.h>
/// Font data stored PER GLYPH
typedef struct {
uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap
uint8_t width; ///< Bitmap dimensions in pixels
uint8_t height; ///< Bitmap dimensions in pixels
uint8_t xAdvance; ///< Distance to advance cursor (x axis)
int8_t xOffset; ///< X dist from cursor pos to UL corner
int8_t yOffset; ///< Y dist from cursor pos to UL corner
} glyph_t;
/// Data stored for FONT AS A WHOLE
typedef struct {
const uint8_t *bitmap; ///< Glyph bitmaps, concatenated
const glyph_t *glyph; ///< Glyph array
uint16_t first; ///< ASCII extents (first char)
uint16_t last; ///< ASCII extents (last char)
2023-04-05 08:08:50 +00:00
uint8_t baseline; ///< Baseline
2023-04-04 14:34:35 +00:00
uint8_t yAdvance; ///< Newline distance (y axis)
} font_t;
extern const font_t free_sans_9pt;
2023-04-13 13:44:05 +00:00
extern const font_t plat_nomor_8pt;
2023-04-04 14:34:35 +00:00
#endif // _FONT_H_