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
100  uint8_t *ptr;
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_
int skip
Definition: user_main.c:304
Definition: font.h:43
Cordic_T X
Main Cordic routine - used for basic trig and vector rotations We use fixed point numbers...
Definition: cordic.c:102
int16_t y[XYSTACK+2]
Definition: ili9341.c:372
static struct ip_info info
Definition: network.c:55
Cordic_T Y
Definition: cordic.c:102
Definition: font.h:58
int16_t x[XYSTACK+2]
Definition: ili9341.c:371
signed char int8_t
Definition: vfont.h:38
unsigned char uint8_t
Definition: send.c:17
Definition: font.h:89
Definition: font.h:70