-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgfx_font.h
More file actions
45 lines (40 loc) · 1.06 KB
/
Copy pathgfx_font.h
File metadata and controls
45 lines (40 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include <cstdint>
#if defined(ARDUINO)
#if __has_include(<M5GFX.h>)
#include <M5GFX.h>
#elif __has_include(<Adafruit_GFX.h>)
#include <Adafruit_GFX.h>
#endif
#include <pgmspace.h>
#else
#ifndef PROGMEM
#define PROGMEM
#endif
#ifndef pgm_read_byte
#define pgm_read_byte(addr) (*(reinterpret_cast<const uint8_t*>(addr)))
#endif
#ifndef pgm_read_word
#define pgm_read_word(addr) (*(reinterpret_cast<const uint16_t*>(addr)))
#endif
#endif
// Only define the font structs if they aren't provided by platform headers.
#if !defined(LGFX_FONTS_HPP_) && !defined(_GFXFONT_H_)
// Minimal Adafruit GFX font structures for local rendering.
// https://github.com/adafruit/Adafruit-GFX-Library/blob/master/gfxfont.h
typedef struct {
uint16_t bitmapOffset;
uint8_t width;
uint8_t height;
uint8_t xAdvance;
int8_t xOffset;
int8_t yOffset;
} GFXglyph;
typedef struct {
const uint8_t* bitmap;
const GFXglyph* glyph;
uint16_t first;
uint16_t last;
uint8_t yAdvance;
} GFXfont;
#endif // !LGFX_FONTS_HPP_ && !_GFXFONT_H_