-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfonts.h
73 lines (57 loc) · 1.74 KB
/
fonts.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
Multifont GFX library is adapted from Adafruit_GFX library by Paul Kourany
v1.0.0, May 2014 Initial Release
v1.0.1, June 2014 Font Compilation update
v1.0.2, Aug 2015 Added charWidth(char) function to return char width in pixels
Please read README.pdf for details
*/
// fonts.h
#ifndef _fonts_h
#define _fonts_h
#include "application.h"
//Font selection for compiling - comment out or uncomment definitions as required
//NOTE: GLCDFONT is default font and always included
//#define TIMESNEWROMAN8
//#define CENTURYGOTHIC8
//#define ARIAL8
//#define COMICSANSMS8
//#define TESTFONT
// Font selection descriptors - Add an entry for each new font and number sequentially
#define TIMESNR_8 0
#define CENTURY_8 1
#define ARIAL_8 2
#define COMICS_8 3
#define GLCDFONT 4
#define TEST 5
#define FONT_START 0
#define FONT_END 1
struct FontDescriptor
{
uint8_t width; // width in bits
uint8_t height; // char height in bits
uint16_t offset; // offset of char into char array
};
// Font references - add pair of references for each new font
#ifdef TIMESNEWROMAN8
extern const uint8_t timesNewRoman_8ptBitmaps[];
extern const FontDescriptor timesNewRoman_8ptDescriptors[];
#endif
#ifdef CENTURYGOTHIC8
extern const uint8_t centuryGothic_8ptBitmaps[];
extern const FontDescriptor centuryGothic_8ptDescriptors[];
#endif
#ifdef ARIAL8
extern const uint8_t arial_8ptBitmaps[];
extern const FontDescriptor arial_8ptDescriptors[];
#endif
#ifdef COMICSANSMS8
extern const uint8_t comicSansMS_8ptBitmaps[];
extern const FontDescriptor comicSansMS_8ptDescriptors[];
#endif
extern const uint8_t glcdfontBitmaps[];
extern const FontDescriptor glcdfontDescriptors[];
#ifdef TESTFONT
extern const uint8_t testBitmaps[];
extern const FontDescriptor testDescriptors[];
#endif
#endif