-
Notifications
You must be signed in to change notification settings - Fork 2
/
FontTools.h
104 lines (82 loc) · 1.73 KB
/
FontTools.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma once
#ifndef FONTTOOLS_H
#define FONTTOOLS_H
#include "main.h"
#include "export.h"
#include "Image.h"
struct SDataGlyph
{
i32 mSliceWidth;
i32 mHeight;
i32 mBaseline;
i32 mWidth;
};
struct FontCharacter
{
SlicedImage2* pImage;
u8 W;
u8 H;
u8 Baseline;
u8 field_7;
};
class Font : public CClass
{
public:
EXPORT Font(void);
EXPORT Font(u8*, const char*);
EXPORT ~Font(void);
EXPORT int GetCharMap(void);
EXPORT void SetCharMap(int);
EXPORT int isEscapeChar(char);
EXPORT char getCharIndex(char);
EXPORT int height(char*);
EXPORT i32 width(const char*);
EXPORT void unload(void);
EXPORT i32 heightBelowBaseline(char*);
EXPORT i32 heightAboveBaseline(char*);
EXPORT void draw(i32, i32, const char*, i32, float);
EXPORT i32 fixedCharWidth(char);
i32 field_4;
i32 field_8;
i32 field_C;
i32 field_10;
u32 mRed;
u32 mGreen;
u32 mBlue;
u8 field_20;
u8 field_21;
i32 field_24;
i32 field_28;
i32 field_2C;
i32 field_30;
i32 field_34;
char field_38[16];
FontCharacter* pCharTab;
i32 NumChars;
i32 Clut;
i32 field_54;
i32 field_58;
u8 field_5C;
u8 field_5D;
u8 field_5E;
u8 field_5F[256];
u8* field_160;
};
class FontManager
{
public:
EXPORT static void ResetCharMaps(void);
EXPORT static char* GetFontName(Font*);
EXPORT static void AllShadowOff(void);
EXPORT static void AllShadowOn(void);
EXPORT static void UnloadFont(Font*);
EXPORT static void UnloadAllFonts(void);
EXPORT static Font* GetFont(const char*);
EXPORT static u8 IsFontLoaded(const char*);
EXPORT static Font* LoadFont(const char*);
EXPORT static Font* LoadFont(u8*, const char*);
};
void validate_Font(void);
void validate_SFontEntry(void);
void validate_SDataGlyph(void);
#endif