-
Notifications
You must be signed in to change notification settings - Fork 3
/
font.h
33 lines (24 loc) · 1.16 KB
/
font.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
#ifndef FONT_H
#define FONT_H
#include <stdint.h>
// ==========================================================================
// structure definition
// ==========================================================================
// This structure describes a single character's display information
typedef struct
{
const uint8_t widthBits; // width, in bits (or pixels), of the character
const uint8_t heightBits; // width, in bits (or pixels), of the character
const uint16_t offset; // offset of the character's bitmap, in bytes, into the the FONT_INFO's data array
} font_char_info;
// Describes a single font
typedef struct
{
const uint8_t heightPages; // height, in pages (8 pixels), of the font's characters
const uint8_t startChar; // the first character in the font (e.g. in charInfo and data)
const uint8_t endChar; // the last character in the font
// const uint8_t spacePixels; // number of pixels that a space character takes up
const font_char_info* charInfo; // pointer to array of char information
const uint8_t* data; // pointer to generated array of character visual representation
} font_info;
#endif /* FONT_H */