-
Notifications
You must be signed in to change notification settings - Fork 1
/
font.ts
136 lines (135 loc) · 6.16 KB
/
font.ts
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
namespace asteroids {
export class font {
public static get width() { return 5; }
public static get height() { return 7; }
public static get glyphs() { return font.glyphs_; }
private static glyphs_: { [id: string]: Polygon } = {
A: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 2), Vec2.N(2, 0), Vec2.N(4, 2), Vec2.N(4, 6)]),
new Polyline([Vec2.N(0, 4), Vec2.N(4, 4)])
]),
B: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(3, 0), Vec2.N(4, 1), Vec2.N(4, 2), Vec2.N(3, 3), Vec2.N(4, 4), Vec2.N(4, 5), Vec2.N(3, 6), Vec2.N(0, 6)]),
new Polyline([Vec2.N(0, 3), Vec2.N(3, 3)]),
]),
C: new Polygon([
new Polyline([Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0)]),
]),
D: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(2, 0), Vec2.N(4, 2), Vec2.N(4, 4), Vec2.N(2, 6), Vec2.N(0, 6), Vec2.N(0, 0)]),
]),
E: new Polygon([
new Polyline([Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0)]),
new Polyline([Vec2.N(0, 3), Vec2.N(3, 3)]),
]),
F: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0)]),
new Polyline([Vec2.N(0, 3), Vec2.N(3, 3)]),
]),
G: new Polygon([
new Polyline([Vec2.N(2, 4), Vec2.N(4, 4), Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0)]),
]),
H: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(0, 6)]),
new Polyline([Vec2.N(4, 0), Vec2.N(4, 6)]),
new Polyline([Vec2.N(0, 3), Vec2.N(4, 3)]),
]),
I: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(4, 6)]),
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0)]),
new Polyline([Vec2.N(2, 0), Vec2.N(2, 6)]),
]),
J: new Polygon([
new Polyline([Vec2.N(4, 0), Vec2.N(4, 6), Vec2.N(2, 6), Vec2.N(0, 4)]),
]),
K: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(0, 6)]),
new Polyline([Vec2.N(0, 4), Vec2.N(4, 0)]),
new Polyline([Vec2.N(0, 2), Vec2.N(4, 6)]),
]),
L: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(0, 6), Vec2.N(4, 6)]),
]),
M: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(2, 2), Vec2.N(4, 0), Vec2.N(4, 6)]),
]),
N: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 6), Vec2.N(4, 0)]),
]),
O: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0)]),
]),
P: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 3), Vec2.N(0, 3)]),
]),
Q: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 4), Vec2.N(2, 6), Vec2.N(0, 6)]),
new Polyline([Vec2.N(2, 4), Vec2.N(4, 6)]),
]),
R: new Polygon([
new Polyline([Vec2.N(0, 6), Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 3), Vec2.N(0, 3)]),
new Polyline([Vec2.N(0, 2), Vec2.N(4, 6)]),
]),
S: new Polygon([
new Polyline([Vec2.N(4, 0), Vec2.N(0, 0), Vec2.N(0, 3), Vec2.N(4, 3), Vec2.N(4, 6), Vec2.N(0, 6)]),
]),
T: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0)]),
new Polyline([Vec2.N(2, 0), Vec2.N(2, 6)]),
]),
U: new Polygon([
new Polyline([Vec2.N(4, 0), Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0)]),
]),
V: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(2, 6), Vec2.N(4, 0)]),
]),
W: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(0, 6), Vec2.N(2, 4), Vec2.N(4, 6), Vec2.N(4, 0)]),
]),
X: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 6)]),
new Polyline([Vec2.N(0, 6), Vec2.N(4, 0)]),
]),
Y: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(2, 2), Vec2.N(4, 0)]),
new Polyline([Vec2.N(2, 2), Vec2.N(2, 6)]),
]),
Z: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(0, 6), Vec2.N(4, 6)]),
]),
0: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0)]),
]),
1: new Polygon([
new Polyline([Vec2.N(2, 0), Vec2.N(2, 6)]),
]),
2: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 3), Vec2.N(0, 3), Vec2.N(0, 6), Vec2.N(4, 6)]),
]),
3: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 6), Vec2.N(0, 6)]),
new Polyline([Vec2.N(4, 3), Vec2.N(0, 3)]),
]),
4: new Polygon([
new Polyline([Vec2.N(4, 0), Vec2.N(4, 6)]),
new Polyline([Vec2.N(0, 0), Vec2.N(0, 3), Vec2.N(4, 3)]),
]),
5: new Polygon([
new Polyline([Vec2.N(4, 0), Vec2.N(0, 0), Vec2.N(0, 3), Vec2.N(4, 3), Vec2.N(4, 6), Vec2.N(0, 6)]),
]),
6: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(0, 6), Vec2.N(4, 6), Vec2.N(4, 3), Vec2.N(0, 3)]),
]),
7: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 6)]),
]),
8: new Polygon([
new Polyline([Vec2.N(0, 0), Vec2.N(4, 0), Vec2.N(4, 6), Vec2.N(0, 6), Vec2.N(0, 0)]),
new Polyline([Vec2.N(0, 3), Vec2.N(4, 3)]),
]),
9: new Polygon([
new Polyline([Vec2.N(4, 6), Vec2.N(4, 0), Vec2.N(0, 0), Vec2.N(0, 3), Vec2.N(4, 3)]),
])
}
}
}