/
DejaVuSans.inl
348 lines (339 loc) · 19.4 KB
/
DejaVuSans.inl
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
// Font generated by stb_font_inl_generator.c (4/1 bpp)
//
// Following instructions show how to use the only included font, whatever it is, in
// a generic way so you can replace it with any other font by changing the include.
// To use multiple fonts, replace STB_SOMEFONT_* below with STB_FONT_DejaVuSans_*,
// and separately install each font. Note that the CREATE function call has a
// totally different name; it's just 'stb_font_DejaVuSans'.
//
/* // Example usage:
static stb_fontchar fontdata[STB_SOMEFONT_NUM_CHARS];
static void init(void)
{
// optionally replace both STB_SOMEFONT_BITMAP_HEIGHT with STB_SOMEFONT_BITMAP_HEIGHT_POW2
static unsigned char fontpixels[STB_SOMEFONT_BITMAP_HEIGHT][STB_SOMEFONT_BITMAP_WIDTH];
STB_SOMEFONT_CREATE(fontdata, fontpixels, STB_SOMEFONT_BITMAP_HEIGHT);
... create texture ...
// for best results rendering 1:1 pixels texels, use nearest-neighbor sampling
// if allowed to scale up, use bilerp
}
// This function positions characters on integer coordinates, and assumes 1:1 texels to pixels
// Appropriate if nearest-neighbor sampling is used
static void draw_string_integer(int x, int y, char *str) // draw with top-left point x,y
{
... use texture ...
... turn on alpha blending and gamma-correct alpha blending ...
glBegin(GL_QUADS);
while (*str) {
int char_codepoint = *str++;
stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR];
glTexCoord2f(cd->s0, cd->t0); glVertex2i(x + cd->x0, y + cd->y0);
glTexCoord2f(cd->s1, cd->t0); glVertex2i(x + cd->x1, y + cd->y0);
glTexCoord2f(cd->s1, cd->t1); glVertex2i(x + cd->x1, y + cd->y1);
glTexCoord2f(cd->s0, cd->t1); glVertex2i(x + cd->x0, y + cd->y1);
// if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct
x += cd->advance_int;
}
glEnd();
}
// This function positions characters on float coordinates, and doesn't require 1:1 texels to pixels
// Appropriate if bilinear filtering is used
static void draw_string_float(float x, float y, char *str) // draw with top-left point x,y
{
... use texture ...
... turn on alpha blending and gamma-correct alpha blending ...
glBegin(GL_QUADS);
while (*str) {
int char_codepoint = *str++;
stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR];
glTexCoord2f(cd->s0f, cd->t0f); glVertex2f(x + cd->x0f, y + cd->y0f);
glTexCoord2f(cd->s1f, cd->t0f); glVertex2f(x + cd->x1f, y + cd->y0f);
glTexCoord2f(cd->s1f, cd->t1f); glVertex2f(x + cd->x1f, y + cd->y1f);
glTexCoord2f(cd->s0f, cd->t1f); glVertex2f(x + cd->x0f, y + cd->y1f);
// if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct
x += cd->advance;
}
glEnd();
}
*/
#ifndef STB_FONTCHAR__TYPEDEF
#define STB_FONTCHAR__TYPEDEF
typedef struct
{
// coordinates if using integer positioning
unsigned short s0,t0,s1,t1;
signed short x0,y0,x1,y1;
int advance_int;
} stb_fontchar;
#endif
#define STB_FONT_DejaVuSans_BITMAP_WIDTH 256
#define STB_FONT_DejaVuSans_BITMAP_HEIGHT 44
#define STB_FONT_DejaVuSans_BITMAP_HEIGHT_POW2 64
#define STB_FONT_DejaVuSans_FIRST_CHAR 32
#define STB_FONT_DejaVuSans_NUM_CHARS 225
#define STB_FONT_DejaVuSans_LINE_SPACING 6
static unsigned int stb__DejaVuSans_pixels[]={
0x0511c545,0x0025c1c4,0x64420910,0x801500c2,0x2019500c,0xb886a039,
0x0dc38d80,0x0dc2c880,0x80603cb8,0x4006b222,0x82983128,0x1104c39a,
0x81b88530,0x203702a9,0x64c1c838,0x5044cc0c,0x32d4ec71,0x07024c51,
0x99702211,0x88208859,0x0bd99225,0x22ceef6e,0x80262028,0x38b85702,
0xab8b1030,0x108734aa,0x5edc0602,0x0810dc2d,0x858620c4,0x2e628982,
0x360e090c,0x20c4c1c9,0x502e0210,0xd7011071,0x58428987,0x664ca215,
0x4ca2150c,0x541c8e64,0xb11cc932,0x08bd8a44,0xbdb960b1,0x16dedc2d,
0x190b6f6e,0x5edc0b98,0x38706c2d,0x47324c73,0x1622dbdb,0x3992658b,
0x22887722,0x982f261b,0x535370bc,0x263cc883,0x1e541c9c,0x3262c4ae,
0xb02f260b,0x0c4d910b,0x739ad625,0x4d263a65,0x39926573,0x91d9b171,
0x96239926,0x3a89b148,0x44b162b0,0x458b12c5,0x88f3220d,0x438722c5,
0x7324c733,0x21d4b162,0x324c910d,0x9220cec7,0x44e6913a,0x23322734,
0x64c6e014,0x42ba441b,0x4d220d8d,0xc98e6913,0x4ea3620d,0x2d629139,
0x5964996b,0x2a7324cb,0x2691b1a9,0x22588e64,0x24c77224,0x50d87508,
0xd8750d87,0xa8dc0bb0,0x23d306c3,0x926399c3,0x30d87539,0x4c930d89,
0x0c644e64,0x9b549922,0x13336a99,0xcc8af632,0x45b1933d,0x2e88b12b,
0xdaa666d4,0x8ea724cc,0x44e6b12a,0x3ca96b14,0x8f2a5966,0x4cccea49,
0x49339e8b,0x4489623a,0x5211648a,0x44986c49,0x20d8930d,0x99ee640d,
0x1c1906c4,0x54931cce,0x9a0d8933,0x54932c68,0x49106363,0x0730732a,
0x5549c5cc,0x4cd24cee,0x730b0733,0x2eba0730,0x489cce66,0x3e2d6293,
0xf0777660,0x5486e581,0x86e58359,0x6ec52248,0x4b73261c,0x134589a5,
0x1916268b,0x89a3b954,0x338706c5,0x2686e587,0x076ecc58,0xb50dcb16,
0x4192443b,0x33323ccc,0x22399243,0x99933dcd,0x580dcc87,0x66479990,
0x3b55953c,0x99b06e64,0x8b12d629,0xb70b1049,0xa99c9899,0x2e266dc2,
0x20289713,0xccd9960b,0x20666cc0,0x5dc0ccd9,0x4c7b9b10,0x71660ccd,
0x6dc3b338,0x0666cc4c,0x71541d88,0x9831099b,0x10000913,0xb0000000,
0x4c1b0000,0x56b10004,0x4c1c40c9,0x3550000c,0x0261d400,0x0030e601,
0x00980000,0x32a05400,0x000262cc,0x00202200,0x01064410,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x9014c000,
0x87101a83,0x4155438b,0x206c42cc,0x22a920cb,0x983c8829,0x438a8482,
0x5307900a,0x80cb9817,0x3207304c,0x10544100,0x10441881,0x07100883,
0x98181039,0xa809880a,0x20666088,0x0c04c0a8,0x40a82554,0x38a81acb,
0x31307028,0x820c1998,0x8844438b,0x2660a0c1,0x9826a60a,0x20a26099,
0x1104b882,0x80440220,0x96031009,0x32212488,0x24191120,0x88715070,
0x5c476f24,0x8ebfa1da,0x5745dadb,0xe86b2e0a,0x872b62ca,0x2f6e0999,
0xca80723b,0x32a1e543,0xc88f3223,0xa4cbe23c,0x12c43cc8,0x4a18ac4b,
0x5d12aae8,0x8aaba255,0x0f3223ca,0xd82ec176,0x1760bb05,0x9dc382ec,
0x0aa1702a,0x0c41542e,0x4aa28625,0x27509148,0x4b138ff9,0x42c06c6c,
0x4cea9348,0x22555d13,0x10c37205,0x2ba44ae9,0x06e0ae91,0x49aec46e,
0x589621b8,0x1489cd62,0x0b10b10b,0x86e0ae91,0x6e4c0dc9,0x2606e4c0,
0x06e4c0dc,0x89603726,0xc8866949,0x32217391,0x13986691,0x49244e69,
0x0ed8963a,0xc9d4e3fa,0x437361c8,0x36e1dde9,0x456a930d,0x17303a85,
0x5895cb1b,0x895d6257,0xcc8f7325,0x9375913d,0x4b11ee64,0x89cd6258,
0x22599d14,0x99d12cce,0x992c4ae5,0x21d4e47b,0x54e43a9c,0x321d4e43,
0x1d4e43a9,0x11718876,0x05ccc477,0x222e6629,0x9a44e63b,0x4732c913,
0x9c5c3b85,0x501b1bba,0xd8ac5667,0x5332e4a8,0x0932cce8,0x731f4526,
0x3399cce6,0x3b954e67,0xda44ee55,0x88ee5549,0x91589625,0x2c42c526,
0x399cc2c4,0xbae8ee55,0x3a35d746,0x35d746ba,0x75d1aeba,0x73881d4d,
0x05c71095,0x91255ce2,0x349a4526,0x9839ac45,0x2e89c5c4,0x158ea0b1,
0x542c526b,0x41160b12,0x320dcccc,0x837320dc,0xb9b10dcc,0x44f73627,
0x33629b54,0x2589623d,0x45333658,0x05885885,0x33621b99,0x3b55953d,
0x5476ab2a,0x5951daac,0x2ab2a3b5,0x3b55951d,0x44917362,0x0b324849,
0x33624c49,0x6533364c,0xd9866dc0,0x99c5c0dc,0x3660ccdd,0x8772a0dd,
0x93361dcc,0x5b993058,0x00000000,0x013a4880,0x16258962,0x22bddf10,
0xddf15eef,0x9836000b,0x0da4c1b4,0x29306d26,0x306d260d,0x02001009,
0x90000020,0x4a2a0000,0x00001000,0x017bbe20,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x201a8081,0x08180512,0x054c0a88,0x11004033,0x33100440,0xb8902333,
0x22541811,0x00ae219a,0x9931c42a,0xa8838a21,0x04410010,0x27595033,
0x1080ccb8,0x214c0988,0x21803118,0x32a03118,0x1982e63a,0x93333310,
0x977b71cc,0x5c126910,0xb1162dbd,0x8aaba233,0x3621ccbe,0x41b9aa80,
0xcc81b9aa,0x44192bbd,0x489cc512,0x41130cd4,0x9e654289,0x21625739,
0x35b11239,0x5221c42e,0x4b6fa259,0x23a29748,0x6c38c849,0x436ae61d,
0x35c07138,0x5220e231,0xbe88364b,0x32ee20cc,0x058e649b,0x664d2f6a,
0x2e58b10c,0x03a83a21,0xb7d1244b,0x2a6ee2a5,0x1557b150,0x064246c4,
0x9190a251,0x11442881,0x65221995,0x30552d63,0x410aa247,0x95910ceb,
0x4aab1488,0x752c9148,0x01b83999,0xa9c4e275,0x12896e21,0x44aa1999,
0x32449d74,0x99263209,0x488cc753,0x5263a697,0x24886c3a,0x8b762cab,
0xa44d0beb,0x8c435558,0x5c3155b2,0x192cce8a,0x326389c4,0x221c43dd,
0xaa9cda23,0x98eea58b,0x44934983,0x438921bc,0xb9d885e8,0x2c526733,
0x04ece44b,0x3886c06e,0x4b487771,0x4ce6d138,0x1222c953,0xa926b10d,
0x5daa2933,0x35926912,0x3a960d89,0x1b15b88b,0x2971b134,0xc94622aa,
0x2eba189b,0x44e20c84,0x10afaa23,0x59223887,0x0f8733b5,0xcd986664,
0x459910ec,0xdd88710c,0x320df442,0x3b9b14cc,0x20b6b6a2,0x4e22c81b,
0x6cdd44e8,0x25922711,0x91164cdc,0xb962a868,0x54e6d161,0x44d2cb34,
0x05d505c5,0xe88ea59a,0x26ee662c,0x31d4a663,0x71009759,0x101b10e2,
0x58e23887,0x2c4199d3,0xa80e6288,0x44488642,0x402445b4,0x59510714,
0x2c837039,0x22cb89c4,0x2713ebb9,0x58ae1638,0x8b075244,0x664c4cdb,
0x4d37324c,0x33661ddd,0x4ea1cc0c,0x33a2dcda,0x541220bc,0x55d40bab,
0x6f44320b,0x89c4194d,0x43880c83,0x2158e238,0x5c4064c0,0x774c0a61,
0x8664193d,0x0244b648,0x5530289c,0x2a7dd903,0x22713ddf,0x9c4b0573,
0x42cc9638,0x05e67445,0x00000126,0x99148000,0x00000001,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x30cccc00,0x26662133,0x99830609,0x40660999,0x204104c1,0x33208860,
0x5ecdee43,0xca833260,0x82f26003,0x3238a21a,0x20a0303c,0x90088001,
0x08199930,0x48542a21,0xb0cca651,0x04431015,0x4410cc11,0x02022021,
0x460604cc,0x7d12bbe8,0x3aeee637,0x2e2c4ae1,0x7d10bbeb,0x7d17c45b,
0x29124522,0x370732f8,0x2c522b70,0x5752aa44,0x139a4493,0x548e6371,
0x90704805,0xb9922370,0x0226222a,0x23755126,0x3b355488,0x542d6455,
0x4b1222cc,0x8dd2ee65,0x1136166a,0x4997d109,0x4244ea1c,0x6c1dc048,
0x910b00d8,0x954c8962,0x91245227,0x991cd762,0x66ee647b,0x2550555c,
0xa8b27648,0x57734ccd,0x39b148e6,0x2008d888,0x320ccecc,0x91c2e0da,
0x2c419999,0x2530eb26,0x20cb9bc8,0x1d7101f8,0x2073261c,0x42f27358,
0x9106e4c5,0x49334910,0x2799d10d,0x24c0dde8,0x21602e88,0x3223cad8,
0x29139c8c,0x914dcce8,0x5caa7355,0x2612e553,0xac733983,0x3260e639,
0x1126912c,0x0ccecc8b,0x42f98240,0xb0480bc8,0x26375501,0x22e5361c,
0x0e6d44bc,0x209b0722,0x4d4e560d,0x911d4e43,0x585d9d10,0x244244b1,
0x202c0588,0x21dad885,0x139cb9c8,0x91489229,0x666c4e76,0x9b779b13,
0x99066647,0x0f73a219,0x2ee67997,0x65533321,0x21a0903c,0x21c8d882,
0xc8281bb9,0x10840ccd,0x24ca6413,0x2014573a,0x26176219,0x1bc9c6c3,
0x09135574,0x53716291,0x82442445,0x1602c00d,0x6d225922,0x92291399,
0x0f6a9148,0x30000400,0x00000141,0xbb1c4240,0x382a1bbb,0x00000000,
0x36000000,0x2e044498,0xaca8b91b,0x910911da,0x88b9106c,0x70914dde,
0x0b05bbbd,0x4ea48858,0x1489cc48,0x3a48a449,0x00000003,0x00000000,
0x00000000,0x00000000,0x391d4000,0x643e61d4,0x229306c5,0xb9d13dde,
0x00009b07,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x32a00000,0x10a59710,0x710cca88,0x2a199199,
0x202a2710,0x0c041880,0x104c4088,0x906eeeec,0x70019999,0x05541714,
0x21cccc89,0x2a79519a,0x0000003c,0x00000000,0x00000000,0x93000000,
0x7074415b,0x3688aa26,0x2ab55a27,0x2444aa73,0x2ac89391,0x444cb871,
0x372f20cb,0x0666660c,0x34371111,0x85128aab,0x40062099,0x00000089,
0x00000000,0x00000000,0x00000000,0x091019d0,0xac910764,0x59229148,
0x564c3b8b,0x71c46f23,0x0cb89265,0x2eeeee00,0x01c46a00,0x00000000,
0x00000000,0x00000000,0x00000000,0x64c00000,0x4d40e23d,0x7158e23b,
0x95724522,0x939124cc,0x00000010,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x10a80000,0x8e20c687,0x24522715,0x080c43f1,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,
};
static signed short stb__DejaVuSans_x[225]={ 0,1,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,
0,0,0,0,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,
-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
1,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,-1,0,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0, };
static signed short stb__DejaVuSans_y[225]={ 7,0,0,0,0,0,0,0,0,0,0,1,5,4,
5,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,2,0,2,0,2,0,2,0,0,
0,0,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,0,0,0,3,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,1,0,
0,0,0,0,0,2,3,4,0,0,0,1,0,0,0,2,0,3,7,0,0,2,0,0,0,0,-1,-1,-1,-1,
-1,-1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,1,0,-1,-1,-1,-1,-1,0,0,0,0,
0,0,0,-1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0,
-1, };
static unsigned short stb__DejaVuSans_w[225]={ 0,2,4,7,5,8,7,2,3,3,5,7,2,3,
2,3,5,5,5,5,5,5,5,5,5,5,1,2,7,7,7,4,8,6,6,6,7,5,5,6,6,2,3,6,
5,7,6,7,5,7,6,5,7,6,6,9,6,7,6,3,3,3,7,6,3,5,5,5,5,5,4,5,5,2,
3,5,2,8,5,5,5,5,4,5,4,5,5,7,5,5,5,4,1,4,7,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,2,5,5,6,6,
1,4,4,7,4,5,7,3,7,4,4,7,3,4,3,6,5,2,2,3,4,5,9,8,9,4,6,6,6,6,
6,6,8,6,5,5,5,5,2,3,4,3,7,6,7,7,7,7,7,6,7,6,6,6,6,7,5,6,5,5,
5,5,5,5,8,5,5,5,5,5,3,3,4,4,5,5,5,5,5,5,5,7,5,5,5,5,5,5,5,5,
6, };
static unsigned short stb__DejaVuSans_h[225]={ 0,7,4,7,9,8,8,4,9,9,5,6,3,1,
2,8,8,7,7,8,7,8,8,7,8,8,5,6,5,3,5,7,9,7,7,8,7,7,7,8,7,7,9,7,
7,7,7,8,7,9,7,8,7,8,7,7,7,7,7,9,8,9,4,2,2,6,8,6,8,6,7,7,7,7,
9,7,7,5,5,6,7,7,5,6,7,6,5,5,5,7,5,9,10,9,3,9,9,9,9,9,9,9,9,9,
9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,7,9,7,6,7,
9,8,2,7,6,5,3,1,7,2,4,6,5,5,2,7,8,2,2,5,6,5,8,8,8,8,8,8,8,8,
8,8,7,9,8,8,8,8,8,8,8,8,7,8,9,9,9,9,9,6,8,9,9,9,9,8,7,8,8,8,
8,8,8,9,6,7,8,8,8,8,7,7,7,7,8,7,8,8,8,8,8,5,7,8,8,8,8,9,9,9,
8, };
static unsigned short stb__DejaVuSans_s[225]={ 173,89,119,187,52,185,1,108,148,169,65,
174,148,185,151,188,192,195,201,198,216,218,224,250,230,236,63,182,50,132,243,
8,28,23,36,248,242,50,56,8,103,100,44,162,30,92,110,27,169,140,85,
44,77,1,43,13,1,69,62,121,35,48,111,173,169,117,21,132,15,151,237,
231,225,222,165,210,207,77,71,138,181,175,58,168,157,162,86,229,237,129,213,
91,1,110,124,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,174,154,159,
148,144,100,65,39,180,64,157,219,140,189,72,164,103,185,225,92,160,141,204,
157,154,251,200,97,166,157,147,142,135,128,121,114,107,100,80,58,82,76,70,
242,61,57,52,252,50,39,83,67,75,132,102,193,210,125,37,21,152,213,58,
200,94,194,46,33,27,96,123,135,173,221,227,179,92,96,107,112,240,117,15,
21,9,207,88,205,123,64,176,182,246,15,9,3,233, };
static unsigned short stb__DejaVuSans_t[225]={ 10,21,37,21,1,1,12,37,1,1,37,
29,37,37,37,12,12,21,21,12,21,12,12,21,12,12,37,29,37,37,29,
30,1,30,30,12,21,29,29,21,29,29,1,21,30,29,29,21,21,1,29,
21,29,21,30,30,30,29,29,1,21,1,37,37,37,29,21,29,21,29,21,
21,21,21,1,21,21,37,37,29,21,21,37,29,21,29,37,29,29,21,29,
1,1,1,37,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,10,21,1,
21,29,21,1,21,37,21,29,29,37,37,21,37,37,29,29,37,37,21,12,
37,37,29,29,37,12,12,12,12,12,12,12,12,12,12,21,1,12,12,12,
12,12,12,12,1,21,12,1,1,1,1,1,29,12,1,1,1,1,1,21,
1,12,1,12,12,12,1,29,21,1,1,1,1,21,21,21,21,1,21,12,
12,12,1,12,29,21,12,12,12,1,1,1,1,1, };
static unsigned short stb__DejaVuSans_a[225]={ 44,55,63,115,87,131,107,38,
54,54,69,115,44,50,44,46,87,87,87,87,87,87,87,87,
87,87,46,46,115,115,115,73,137,94,94,96,106,87,79,107,
103,41,41,90,77,119,103,108,83,108,96,87,84,101,94,136,
94,84,94,54,46,54,115,69,69,84,87,76,87,85,48,87,
87,38,38,80,38,134,87,84,87,87,57,72,54,87,81,112,
81,81,72,87,46,87,115,82,82,82,82,82,82,82,82,82,
82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,
82,82,82,82,82,82,82,82,44,55,87,87,87,87,46,69,
69,137,65,84,115,50,137,69,69,115,55,55,69,87,87,44,
69,55,65,84,133,133,133,73,94,94,94,94,94,94,134,96,
87,87,87,87,41,41,41,41,107,103,108,108,108,108,108,115,
108,101,101,101,101,84,83,87,84,84,84,84,84,84,135,76,
85,85,85,85,38,38,38,38,84,87,84,84,84,84,84,115,
84,87,87,87,87,81,87,81,94, };
// Call this function with
// font: NULL or array length
// data: NULL or specified size
// height: STB_FONT_DejaVuSans_BITMAP_HEIGHT or STB_FONT_DejaVuSans_BITMAP_HEIGHT_POW2
// return value: spacing between lines
static void stb_font_DejaVuSans(stb_fontchar font[STB_FONT_DejaVuSans_NUM_CHARS],
unsigned char data[STB_FONT_DejaVuSans_BITMAP_HEIGHT][STB_FONT_DejaVuSans_BITMAP_WIDTH],
int height)
{
int i,j;
if (data != 0) {
unsigned int *bits = stb__DejaVuSans_pixels;
unsigned int bitpack = *bits++, numbits = 32;
for (i=0; i < STB_FONT_DejaVuSans_BITMAP_WIDTH*height; ++i)
data[0][i] = 0; // zero entire bitmap
for (j=1; j < STB_FONT_DejaVuSans_BITMAP_HEIGHT-1; ++j) {
for (i=1; i < STB_FONT_DejaVuSans_BITMAP_WIDTH-1; ++i) {
unsigned int value;
if (numbits==0) bitpack = *bits++, numbits=32;
value = bitpack & 1;
bitpack >>= 1, --numbits;
if (value) {
if (numbits < 3) bitpack = *bits++, numbits = 32;
data[j][i] = (bitpack & 7) * 0x20 + 0x1f;
bitpack >>= 3, numbits -= 3;
} else {
data[j][i] = 0;
}
}
}
}
// build font description
if (font != 0) {
//float recip_width = 1.0f / STB_FONT_DejaVuSans_BITMAP_WIDTH;
//float recip_height = 1.0f / height;
for (i=0; i < STB_FONT_DejaVuSans_NUM_CHARS; ++i) {
// pad characters so they bilerp from empty space around each character
font[i].s0 = (stb__DejaVuSans_s[i]);// * recip_width;
font[i].t0 = (stb__DejaVuSans_t[i]);// * recip_height;
font[i].s1 = (stb__DejaVuSans_s[i] + stb__DejaVuSans_w[i]);// * recip_width;
font[i].t1 = (stb__DejaVuSans_t[i] + stb__DejaVuSans_h[i]);// * recip_height;
font[i].x0 = stb__DejaVuSans_x[i];
font[i].y0 = stb__DejaVuSans_y[i];
font[i].x1 = stb__DejaVuSans_x[i] + stb__DejaVuSans_w[i];
font[i].y1 = stb__DejaVuSans_y[i] + stb__DejaVuSans_h[i];
font[i].advance_int = (stb__DejaVuSans_a[i]+8)>>4;
//font[i].s0f = (stb__DejaVuSans_s[i] - 0.5f) * recip_width;
//font[i].t0f = (stb__DejaVuSans_t[i] - 0.5f) * recip_height;
//font[i].s1f = (stb__DejaVuSans_s[i] + stb__DejaVuSans_w[i] + 0.5f) * recip_width;
//font[i].t1f = (stb__DejaVuSans_t[i] + stb__DejaVuSans_h[i] + 0.5f) * recip_height;
//font[i].x0f = stb__DejaVuSans_x[i] - 0.5f;
//font[i].y0f = stb__DejaVuSans_y[i] - 0.5f;
//font[i].x1f = stb__DejaVuSans_x[i] + stb__DejaVuSans_w[i] + 0.5f;
//font[i].y1f = stb__DejaVuSans_y[i] + stb__DejaVuSans_h[i] + 0.5f;
//font[i].advance = stb__DejaVuSans_a[i]/16.0f;
}
}
}
#ifndef STB_SOMEFONT_CREATE
#define STB_SOMEFONT_CREATE stb_font_DejaVuSans
#define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_DejaVuSans_BITMAP_WIDTH
#define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_DejaVuSans_BITMAP_HEIGHT
#define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_DejaVuSans_BITMAP_HEIGHT_POW2
#define STB_SOMEFONT_FIRST_CHAR STB_FONT_DejaVuSans_FIRST_CHAR
#define STB_SOMEFONT_NUM_CHARS STB_FONT_DejaVuSans_NUM_CHARS
#define STB_SOMEFONT_LINE_SPACING STB_FONT_DejaVuSans_LINE_SPACING
#endif