ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
font.h
Go to the documentation of this file.
1 
33 #ifndef _FONT_H_
34 #define _FONT_H_
35 
36 //#include "stdint.h"
37 
38 #define MAXFONTS 256 /* Maximum number of fonts to convert at one time */
39 #define MAXGLYPHS 256 /* Max Glyphs Per Font */
40 #define MAXWIDTH 127 /* Max Character Width */
41 #define MAXHEIGHT 127 /* Max Character Height */
42 
43 typedef struct
44 {
45  char *filename;
46  char *structname;
47 } _bdffile;
48 
49 typedef struct
50 {
51  int Offset; /* Byte offset to Glyph bit array */
52  uint8_t Width; /* Glyph width in bits */
53  uint8_t Height; /* Glyph hight in bits */
54  int8_t X; /* Glyph X offset when rendered */
55  int8_t Y; /* Glyph Y offset when rendering */
56 } _fontspecs;
57 
58 typedef struct
59 {
60  char *FILE_NAME; /* FILE NAME */
61  char *STRUCT_NAME; /* STRUCT NAME */
62  char *COPYRIGHT; /* COPYRIGHT */
63  char *FONT_NAME; /* FONT */
64  char *FAMILY_NAME; /* FAMILY NAME */
65  char *WEIGHT_NAME; /* WEIGHT_NAME */
66  char *SLANT; /* SLANT */
67  char *SPACING; /* SPACING */
68 } _fontinfo;
69 
70 typedef struct
71 {
72  int16_t Glyphs; /* Glyphs in this font */
73  uint8_t Fixed; /* Fixed Format Font, Font info not required */
74  int16_t First; /* First Font value in this font set set */
75  uint8_t Width; /* Glyph Width in bits for this font set */
76  uint8_t Height; /* Glyph Hight in bits for this font set */
77  int8_t X; /* Glyph X orgin for this font set */
78  int8_t Y; /* Glyph Y orgin for this font set */
79  int8_t Ascent; /* Glyph Ascent for this font set */
80  int8_t Decent; /* Glyph Decent for this font set */
81  int8_t gap; /* Glyph gap */
82 /* Working font bitmap buffer */
83  int Bytes; /* Number of bytes in bitmap */
84  uint8_t *bitmap; /* Font Bitmap */
85  _fontspecs *specs; /* Glyph info */
86  _fontinfo *info; /* Copywrite, etc */
87 } _font;
88 
89 typedef struct
90 {
91  int8_t index; // font index
92  int8_t flags; // font and window attributes
93  int8_t w; // font width - caries for each character
94  int8_t h; // font hight
95  int8_t x; // font x orgin of glyph
96  int8_t y; // font x orgin of glyph
97  int8_t Width; // font max width
98  int8_t Height; // font max width
99  int8_t skip; // font spacing - zero for fixed fonts
101 } _fontc;
102 
103 #if 0
104 typedef struct {
105  int16_t xoff; /* X offset */
106  int16_t yff; /* Y offset */
107  int16_t w; /* Width */
108  int16_t h; /* Height */
109  int16_t xinc; /* Distance to Next Character by X */
110  int16_t yinc; /* Distance to Next Character by Y */
111  int16_t hby; /* gm.horiBearingY */
112  int16_t vby; /* gm.vertBearingY */
113  int16_t contours; /* Contours */
114  int16_t v[]; /* Data */
115 } path_t;
116 #endif
117 
118 #endif //_FONT_H_
int8_t Decent
Definition: font.h:80
char * COPYRIGHT
Definition: font.h:62
Definition: font.h:43
int8_t w
Definition: font.h:93
int8_t Ascent
Definition: font.h:79
int8_t Width
Definition: font.h:97
uint8_t * bitmap
Definition: font.h:84
int8_t skip
Definition: font.h:99
int8_t h
Definition: font.h:94
int8_t flags
Definition: font.h:92
uint8_t Width
Definition: font.h:52
int8_t y
Definition: font.h:96
Definition: font.h:58
uint8_t Height
Definition: font.h:76
char * FAMILY_NAME
Definition: font.h:64
int8_t x
Definition: font.h:95
int Offset
Definition: font.h:51
char * FILE_NAME
Definition: font.h:60
int8_t Y
Definition: font.h:55
int8_t index
Definition: font.h:91
_fontspecs * specs
Definition: font.h:85
char * SLANT
Definition: font.h:66
uint8_t * ptr
Definition: font.h:100
signed char int8_t
_fontinfo * info
Definition: font.h:86
int8_t Y
Definition: font.h:78
int8_t X
Definition: font.h:54
uint8_t Height
Definition: font.h:53
int16_t First
Definition: font.h:74
uint8_t Width
Definition: font.h:75
Definition: vfont.h:38
int8_t Height
Definition: font.h:98
uint8_t Fixed
Definition: font.h:73
char * WEIGHT_NAME
Definition: font.h:65
char * SPACING
Definition: font.h:67
int Bytes
Definition: font.h:83
char * FONT_NAME
Definition: font.h:63
int16_t Glyphs
Definition: font.h:72
int8_t gap
Definition: font.h:81
unsigned char uint8_t
Definition: send.c:17
char * filename
Definition: font.h:45
Definition: font.h:89
int8_t X
Definition: font.h:77
char * STRUCT_NAME
Definition: font.h:61
Definition: font.h:70
char * structname
Definition: font.h:46