-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGFXFont.h
40 lines (35 loc) · 1.37 KB
/
GFXFont.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
//***********************************************************************************
// GFXFont.h
//***********************************************************************************
#pragma once
#include <stdint.h>
namespace DadGFX {
// Character descriptor table
typedef struct
{
uint16_t bitmapOffset; // Pointer into GFXfont->bitmap
uint8_t width; // Bitmap width in pixels
uint8_t height; // Bitmap height in pixels
uint8_t xAdvance; // Distance to advance cursor (x-axis)
int8_t xOffset; // X offset from cursor position to upper-left corner
int8_t yOffset; // Y offset from cursor position to upper-left corner
} GFXglyph;
// Font C descriptor
typedef struct
{
uint8_t * bitmap; // Glyph bitmaps, concatenated
GFXglyph * glyph; // Array of glyph descriptors
uint16_t first; // ASCII range: first character
uint16_t last; // ASCII range: last character
uint8_t yAdvance; // Line height (y-axis)
} GFXCFont;
// Font Binary descriptor
typedef struct
{
uint32_t bitmap; // Offset of Glyph bitmaps, concatenated
uint32_t glyph; // Array of glyph descriptors
uint16_t first; // ASCII range: first character
uint16_t last; // ASCII range: last character
uint8_t yAdvance; // Line height (y-axis)
} GFXBinFont;
} // DadGFX;