// 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_arial_12_latin1_*, // and separately install each font. Note that the CREATE function call has a // totally different name; it's just 'stb_font_arial_12_latin1'. // /* // 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 float s0,t0,s1,t1; signed short x0,y0,x1,y1; int advance_int; // coordinates if using floating positioning float s0f,t0f,s1f,t1f; float x0f,y0f,x1f,y1f; float advance; } stb_fontchar; #endif #define STB_FONT_arial_12_latin1_BITMAP_WIDTH 256 #define STB_FONT_arial_12_latin1_BITMAP_HEIGHT 56 #define STB_FONT_arial_12_latin1_BITMAP_HEIGHT_POW2 64 #define STB_FONT_arial_12_latin1_FIRST_CHAR 32 #define STB_FONT_arial_12_latin1_NUM_CHARS 224 #define STB_FONT_arial_12_latin1_LINE_SPACING 8 static unsigned int stb__arial_12_latin1_pixels[]={ 0x02883272,0x205702cc,0x22038848,0x0cb9e443,0x04404444,0x50f332a2, 0x19b305b9,0x400b8288,0x880bcdb9,0x201e521d,0x300ea00b,0x70088806, 0x15412140,0x00c00c60,0x5300444c,0x1c407220,0x0544c14c,0x501b8093, 0x206e0197,0x4983700c,0x06e6e0e4,0x7fe45dd7,0x2276e1e9,0x22cc744c, 0x2e039818,0xb81b511c,0x2201d343,0x40ab2203,0x39303dba,0x0a607307, 0x2d60120d,0x790066a0,0xb806401b,0x903700da,0x6cc2e0b8,0x0b82e1cb, 0x87138871,0x43892638,0x11c89338,0x35b13887,0x135ffa1d,0x102e870d, 0x40bdb885,0xb191953a,0x01b341c8,0x71017b71,0x7b71017b,0x817b7101, 0x216dc40d,0x4400c886,0x0074c00c,0x33220322,0x99911ccc,0x33322399, 0x295121cc,0x3a6be668,0x689a2950,0x34468b44,0x9b44689a,0x44688e44, 0xfc835956,0x2202d4d7,0x724c0cec,0x958d715b,0x3916bb37,0x5b707268, 0x8adb8d71,0x5c56dc6b,0x35c56dc6,0x1d93d11a,0x201edc34,0x1edc03db, 0x3a20f6e0,0x3d109999,0x27a21333,0xd11e0999,0x4b2598ea,0x23447568, 0x4688d168,0x26d11a26,0x44688e44,0xf507dd16,0x95c04a9a,0x0e9260eb, 0x268c99e4,0x21a6194b,0xc81d1262,0x747903a3,0xc81d1e40,0xb8c98b33, 0x03474340,0xd1d01a3a,0x68868e80,0x06881a20,0x306ce43c,0x1b391dc9, 0x345a2344,0x1a21d1a2,0x239126d1,0x36e34468,0x1a26b40e,0x2b874c2e, 0xacc34d26,0x24b24aaa,0x31d88077,0x21a6b30d,0x2b30d359,0x89359869, 0x4c681aca,0x6d6605b5,0x40b6b302,0xaf885b59,0x2abe22aa,0x2aabe22a, 0x22ecc3c2,0x5d987a69,0x345a2344,0x2344d1a2,0x11c89368,0x3511688d, 0x2d8d6859,0x1b7d316a,0x5984aa4c,0x23e2d393,0xc9206c2c,0x556612a2, 0x30955984,0x456612ab,0x21da7446,0x82dcde46,0x7905b9bc,0x26f20b73, 0x5557c45b,0x8aaabe22,0x3c2aaaf8,0x7774c2e8,0x4c782e83,0x2c4b31e5, 0x9126b31e,0x655663c3,0x46b41d9a,0x880deed8,0x879a4c4d,0x6e765a4c, 0x9341c82d,0x9a643cc3,0x90f34c87,0x69321e69,0x1343deb8,0x881f999d, 0x440fccce,0x440fccce,0x220fccce,0x6881a206,0x498683c0,0x321e8340, 0x2e4c87a4,0x26990f42,0x643d0e44,0x5a13bb64,0x79205706,0x2617b254, 0x26036a1e,0x6cd0720e,0x1e985ec0,0xb0f4c2f6,0xbd87a617,0x215c3d30, 0x2254d039,0x0f22543c,0x2543c895,0x220688f2,0x8f01a206,0x304983d9, 0x3fba207b,0x22ff7445,0x25fee885,0x443d73e9,0x01a85fee,0x416e21ad, 0x0ba65ddc,0xb303ddd9,0xa819d99b,0xc835da1d,0xeec81eee,0x1eeec81e, 0x581eeec8,0x07a6805c,0x3c41e8f1,0x1e8f107a,0xffff13c4,0x3fffe29f, 0xfffff14f,0x080223c9,0x00000110,0x884c0004,0x42008001,0x04400880, 0x26000022,0x22104401,0x00000000,0x04001000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x07300aa0,0x08401910,0x86300c88,0x5520d431, 0xeca81621,0x214dc48b,0x81793058,0x01b029b9,0x260ae01b,0x303601dd, 0x20360537,0x3209904c,0x542baa84,0x15d542ba,0x4c3880ec,0x0aa1c44c, 0x1c42a853,0x019006c4,0x4ac80190,0x59032320,0xac5b7709,0x03291125, 0x715b7055,0x4076c43f,0x34cf442a,0x0aa02e6a,0xf82b81cc,0x50550688, 0x50550173,0x1bba8377,0x2260ddd4,0x204ccc09,0x03880999,0x20d88871, 0x588f260d,0x20361e4c,0x1cc2a82a,0x64400c88,0xccccc880,0x70322241, 0xcedb9224,0x882ee23f,0xb88f760f,0x705dc44c,0x02ee2049,0xcc985993, 0xd11664c2,0x02ee2162,0xbb885993,0x2605dc40,0x05dc42cc,0x7710b326, 0x220bb881,0x307102e2,0x8e606e19,0x06e3980c,0x1f305c51,0x03db80f4, 0x4f441edc,0x223c0999,0x3c79a24f,0x741b3591,0x9c96a6a9,0x83eaba5a, 0x80ee6a9e,0x23a66a9e,0xf31d30f9,0x43e63a61,0x53d05959,0x07cc74cd, 0xa9e8d53d,0x83e63a66,0x23a66a9e,0x1aa7a0f9,0xb24cd53d,0x6ddc4a83, 0x2a730498,0x21267303,0x2b707649,0x01a3a04b,0x00d10d1d,0xd12ee88f, 0x731b1e3c,0xb8ed56d4,0x2556a574,0x12c8ea59,0x323a874b,0x887aa622, 0x2a621ea9,0x516eb31e,0x4c43b55b,0x964751ea,0xa988b23a,0x3b55b51e, 0xda8f54c4,0x64751daa,0xd30ec932,0x1c962101,0x41ccac44,0x24c72588, 0x40d7d03b,0x56605b59,0x5557c42d,0x74ec4782,0x5cf1e688,0x5b73dece, 0x8eb66355,0xb9dc573c,0x2ddb8ee2,0x9d33b8ae,0x2b3a63d5,0x3d59d31e, 0x36e6b966,0x59d31aaa,0x73b8ae3d,0xace99dc5,0x3555b71e,0x5c7ab3a6, 0x4571aaad,0xd0ec933b,0x3d70c801,0x093311b0,0x24c7ae19,0x403f303b, 0x7905b9bc,0xaaf88b73,0xbac4782a,0x44f1e68c,0x392c41b4,0x261d52f4, 0x3b2cc3a5,0x3b2cc2c8,0x3b8f44ee,0x744ee3d1,0x43a31b31,0x89dc7258, 0x98ecb31e,0xe89dc765,0x3b8e4b11,0x1c9623d1,0x2598ecb3,0x544b9a1f, 0x2b859b33,0x26750362,0x0fcb32cd,0x333a2078,0x667440fc,0x201a20fc, 0x4d5d2c47,0x216753c7,0x37264ddb,0x6ed41dee,0x26276dc3,0x24edb84c, 0xd12ddce8,0x33a25bb9,0xbd1b32dd,0x224ddb89,0x36e2ddce,0x1276dc4e, 0x6dc5bb9d,0x3773a24d,0xb71376e2,0x1dbdd89d,0x5883b36e,0x2498f6a6, 0x99622be8,0x36f763da,0x22540f01,0x8f22543c,0x2c478068,0x89e3cdf3, 0x00400010,0x00000000,0x00000000,0x00000000,0x00000000,0x81020101, 0x04020998,0x07a07800,0x3c41e8f1,0x89fffff1,0x79ae2c47,0x0000003c, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x090e5c00,0x41e4076e,0xa8e22baa,0x22480511,0xcec980cc, 0xb82e5300,0x2e033260,0x505c02cc,0x1ca81999,0x2242ccb8,0xba89c438, 0x054e4c1c,0xdc981791,0x20bdb882,0x202f221b,0xac982dca,0x033b220a, 0x8302f72a,0x1dc0713a,0x22399993,0x4520cccc,0x9509358c,0x837750d1, 0xc9620989,0xd2440932,0x89da8d53,0x953b80ea,0x6a9e89a2,0x6c0930e4, 0xe82aaba1,0x930e4699,0x688d1064,0x261d35f3,0x27a1fa9e,0x0744ec69, 0x5cd715b7,0xb8b33d11,0x3a64c89d,0x22ba1fa9,0x22b6e0fa,0x2191a25b, 0x4c9019e8,0x3d31faaa,0xb39bcd53,0x1a76a036,0x22885c51,0x9964b10b, 0xa9541cac,0x1a8787a5,0x8ead13b8,0xcd9b9e18,0x2f26399c,0x12541a1d, 0x4d66d4dc,0x22344553,0x3b964b36,0x21d3447a,0x40e82268,0xc92a153c, 0x1dc70d11,0x2171a23d,0x7f73c878,0xddddf124,0x263b8241,0x33678745, 0x03ba039a,0x2498ec93,0x9964d11d,0x4360e9af,0x02ccb23b,0x06ce4770, 0x5d691ecc,0x3ee7a292,0x5c7dbd31,0x12d22edc,0x88d12452,0x3b9dc936, 0x23ddc876,0x434c09f9,0xd92a1959,0x22b80b52,0x5073f21d,0x83a6950b, 0x3c991a27,0x2aba6344,0x23611e4c,0x27af60cb,0x98ec930a,0x5d3c4764, 0xb963c966,0xf92d4b23,0x6cc7709f,0x521d7305,0xd1dd25cd,0xd71e8a23, 0x12521d11,0xd11a2592,0x4b11e9a6,0x1b75b11f,0x0950f7ae,0xcce872b3, 0x5980952e,0xedb883f1,0x22b50970,0x3b8d13c6,0x5d30ee1e,0x261e1d95, 0x29548c9b,0x1d9266e9,0xee88ec93,0x95c932ee,0x11d92a39,0x5c22930d, 0x59041743,0xa44dd632,0x9dc0762c,0x6464b249,0x86e48baa,0xeee9acc7, 0xb8f76dc3,0x981d8b23,0x983b4c87,0x170d11c8,0x298f66d4,0x4d8799e4, 0x2ba278d1,0x3a1e0eca,0x3cee2cc0,0x966b39ac,0x8fcb30ed,0x82c47e59, 0x10dc3a69,0xc899074d,0x0d0b2774,0x2d8874b3,0x3f2d436a,0xe960e966, 0x36266b11,0x321e8e60,0x47600934,0x02c47649,0x6c7a617b,0x5b074912, 0x874312d4,0x3d8b20e9,0xf1a21f99,0x3c0d5744,0x5b1661a2,0x1e6c731e, 0x6cb77dd7,0x2f761dbd,0x3660b11d,0x36a163dd,0xcfeec82e,0x6ccbdd10, 0x887bb903,0x7640cccc,0x0b7721ec,0xcc887db5,0x3a2580cc,0x401265fe, 0xd8f7721d,0x7643eedd,0xdc8b61ee,0x6f76c42d,0x2a26e740,0x76c44eef, 0x793a2ede,0x4a8f01a2,0x24ffff98,0x00004047,0x08000800,0x11000000, 0x00000000,0x00200000,0x00010008,0x00110002,0x02008800,0x00000500, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x982e0000,0x220d4122,0xd981cccc,0x9999301c, 0x66664499,0x80a2511c,0x44a229b8,0x700c8802,0x40ddcc3d,0x43b12d64, 0x441cccc8,0x02e4cccc,0x91c43892,0xcb8ae1c4,0x9931cccc,0x30aa1999, 0xb8aa1cc7,0x64470ea0,0xcc8864c1,0x703222cc,0x666440e2,0x43d2d43c, 0x7442f984,0x3a22ea99,0xeae80e88,0x27a2199a,0x26930999,0x886e6a04, 0x7b700931,0x99e883e0,0x4529f626,0x267a259c,0x267a22ea,0x49512e19, 0x21f34468,0x53117259,0x2662133d,0xe83e66b9,0x20e89ec1,0x2599ba3b, 0x887e45f9,0xf12e999e,0x1059b449,0xd8b9333d,0x2cd805a9,0x189a2344, 0x03ab50b2,0x26930344,0x64d44734,0x6564ca22,0xf90d1d01,0x365b14c9, 0x2224247a,0x40d134c6,0x8d10ec68,0xb9599e68,0x3a202cc0,0x884badc0, 0x8a4c1e9e,0x6cc572cd,0x3443b60e,0x8977452e,0x11a20b36,0x400ed98d, 0x4f542b9c,0x03a603e1,0x86aafa3d,0x262aaaf8,0x4c1d3934,0x2930f9af, 0x4c0f9af9,0x01e985b5,0x43c781d1,0x887c3447,0x8ec1aaaf,0x6667c468, 0x7cd99e6c,0x5d102cc0,0xfa81afa0,0x52aead03,0x54af660d,0x6ccd10eb, 0xd11d3b12,0x4cf44166,0x3bbae3da,0x0ae9303e,0x207499f9,0x4cf4c0e8, 0x3e21aabe,0x4d262aaa,0x3b2cc1fe,0x83b2cd26,0x0685b9bc,0x878f05d1, 0x88743447,0xa541cccf,0x5557c43b,0xccf99a6b,0x3d816604,0xfa807e60, 0x5a1b1b04,0x8cacecc6,0x5bddf10e,0x368cbac4,0x3f33e20b,0x0d66d4c2, 0x1777774f,0x3b8788d1,0x00feeed8,0xe9a4c0d1,0x23b24c4b,0x10ec9349, 0x681f999d,0x78f01e88,0x9e234478,0x81d68068,0x4cb34468,0x16603d16, 0x103c02dc,0xd5703d1d,0x7566256c,0x81a21d58,0x2cdaba58,0x883aa688, 0x89209bc9,0x1a20bc99,0x69811079,0x20688074,0x98b69349,0x49a4c764, 0x1e44a876,0x3c03d11a,0xc8d11e1e,0x33201a24,0x83446884,0x2603a659, 0x0f006a85,0x4c0e9974,0xb30b6e4d,0x68874f6e,0x36f99620,0x0991a20b, 0x0ae03077,0x209ffff1,0x3fa16c3c,0xfff10fff,0xa4d269ff,0x8ec930e8, 0xd0ec9349,0x32347883,0x23c2ffff,0x7ffc4787,0x4403444e,0x3446881f, 0x216e2ccf,0xffffd859,0x8990781f,0x1e62f85b,0x0e87c566,0x2e2c40d1, 0x29ffff36,0x000f4468,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x32e00000,0x260a8a23,0x503ca9cc, 0x05dc4759,0x99302f26,0x77101305,0x0cccccc1,0x97510010,0x4d443911, 0x5cb2a21c,0x2351c2e0,0xa8e25528,0x10024ccc,0x08808402,0x3c992040, 0x42a83322,0x6441b03c,0x5449930c,0x42ee1aaa,0x551aaaa8,0x54106604, 0x3b8ca9ba,0x8d986c93,0x6c4b8df9,0x267a3f9b,0x99667a26,0x15c0e98e, 0x101354f4,0x4363eb88,0x7f53f30d,0x74d7ccd3,0x4ee35f30,0xba747268, 0x445b1d12,0x33a64d99,0x440d8d80,0x4c39858d,0x88e1eeee,0x253370d8, 0x333313c9,0x7311edc1,0xbb88dc67,0x271531bb,0x774cbbb8,0x23dda8e4, 0x3a676ee7,0x20d9260a,0x7aabfa88,0x5b55abb4,0x4092a3b5,0x9530ea98, 0x1c8ea159,0x0fb22101,0x2598f7a6,0x1b2cc767,0x8ead1166,0x98d6c8ba, 0x2a0b504e,0x167261dd,0x5cc43b3b,0x0345a09c,0x1c464326,0x33332a73, 0xbbc9a3a2,0x111112e3,0x29100cc8,0x6649912a,0x30caa920,0x0d9267d9, 0x777d59d1,0xac5cecc7,0x771bbbdb,0x436b3a20,0x571bddba,0xd30809dc, 0x93076c07,0xd926393c,0x1b3b0930,0x459daad8,0x406983f8,0x9a3a23ea, 0x6e4c68e8,0x034b13ce,0x37661b77,0xa8570e60,0x52f2e574,0xddd30beb, 0x41c4007d,0x80604408,0xe966d12a,0x44be2770,0x895d3a24,0x4d2c4725, 0x85707a3b,0x04047659,0x5ec19d71,0x93c930e9,0x930d9263,0x1bb0bb50, 0x1e9d85d5,0x3ae203a2,0x215ce40c,0x43983aba,0x020fccf8,0x02604001, 0x88806213,0x00000000,0x5dbb1000,0xd886deec,0x41ddd9dd,0x6edc5ddd, 0xd116edc4,0x81a85bbb,0x02023edb,0x930c31d4,0xd926393c,0x20be0930, 0x9dc1f16b,0x3bbbb669,0x03940530,0x330a60e7,0x003c3533,0x00000000, 0x00000000,0x20000000,0x01000000,0x005dddd7,0x00333333,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x8c2ee000,0x9b820998,0x22498a0b,0x223bbbbb,0x33333224,0x00000004, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0xd7770000, 0x78332e9f,0x2e582626,0x04444440,0x0000002e,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000, }; static signed short stb__arial_12_latin1_x[224]={ 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,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,0,0, -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,1,0,0,0,-1, 0,0,0,0,0,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1, -1,-1,0,0,0,0,0,0,0,0,-1,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,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; static signed short stb__arial_12_latin1_y[224]={ 9,1,1,1,0,1,1,1,1,1,1,2,7,5, 7,1,1,1,1,1,1,1,1,1,1,1,3,3,2,3,2,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,1,3,1,3,1,3,1,3,1,1, 1,1,1,3,3,3,3,3,3,3,1,3,3,3,3,3,3,1,1,1,4,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,9,3,1,1,2,1, 1,1,1,1,1,3,3,5,1,0,1,2,1,1,1,3,1,4,8,1,1,3,1,1,1,3,-1,-1,-1,-1, -1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,2,1,-1,-1,-1,-1,-1,1,1,1,1, 1,1,1,1,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,1,1,1,1,1,1,1, }; static unsigned short stb__arial_12_latin1_w[224]={ 0,3,4,6,6,9,7,2,4,4,4,6,3,4, 3,3,6,4,6,6,6,6,6,6,6,6,3,3,6,6,6,6,11,9,7,8,8,7,7,8,7,2,5,8, 6,9,7,8,7,8,8,7,7,7,8,11,8,8,7,3,3,3,5,8,3,6,6,6,6,6,4,6,6,2, 3,6,2,9,6,6,6,6,4,5,3,6,6,8,6,6,6,4,2,4,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,2,6,6,6,7, 2,6,4,8,4,6,6,4,8,8,4,6,4,4,3,6,6,3,3,3,4,6,9,9,9,6,9,9,9,9, 9,9,11,8,7,7,7,7,3,3,5,3,9,7,8,8,8,8,8,6,8,7,7,7,7,8,7,7,6,6, 6,6,6,6,10,6,6,6,6,6,3,3,5,3,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, }; static unsigned short stb__arial_12_latin1_h[224]={ 0,8,4,9,11,9,9,4,11,11,4,6,4,2, 2,9,9,8,8,9,8,9,9,8,9,9,6,8,6,4,6,8,11,8,8,9,8,8,8,9,8,8,9,8, 8,8,8,9,8,9,8,9,8,9,8,8,8,8,8,11,9,11,5,2,2,7,9,7,9,7,8,9,8,8, 11,8,8,6,6,7,9,9,6,7,9,7,6,6,6,9,6,11,11,11,3,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,9,11,9,6,8, 11,11,2,9,5,6,4,2,9,1,4,7,5,5,2,9,11,2,4,5,5,6,9,9,9,9,10,10,10,10, 10,10,8,11,10,10,10,10,10,10,10,10,8,10,11,11,11,11,11,6,9,11,11,11,11,10,8,9,9,9, 9,9,9,9,7,9,9,9,9,9,8,8,8,8,9,8,9,9,9,9,9,5,7,9,9,9,9,11,11,11, }; static unsigned short stb__arial_12_latin1_s[224]={ 254,155,251,60,67,1,11,235,171,38,242, 161,247,8,13,47,51,106,99,80,13,103,110,238,152,178,175,9,74,216,140, 30,110,84,245,185,121,49,130,58,147,253,67,159,240,214,232,166,224,209,247, 201,168,130,138,202,193,184,176,51,126,55,200,30,39,46,40,39,96,32,94, 194,77,74,97,60,57,88,98,60,138,145,105,1,218,7,110,117,126,73,133, 122,183,130,1,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67, 67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,254,175,176, 159,168,1,127,90,17,117,206,154,228,8,87,43,223,53,211,179,26,33,74, 22,238,189,184,147,237,227,217,210,10,186,20,216,196,206,37,81,242,226,234, 30,250,56,38,52,20,44,101,135,144,153,162,81,74,30,43,22,59,1,226, 132,118,111,168,147,182,125,14,97,67,140,175,189,234,222,115,111,83,67,90, 154,161,104,196,193,25,203,247,19,26,15,8,1, }; static unsigned short stb__arial_12_latin1_t[224]={ 1,34,43,13,1,24,24,43,1,1,43, 43,43,51,51,24,24,34,34,24,34,24,24,24,24,24,43,34,43,43,43, 34,1,34,24,24,34,34,34,24,34,24,24,34,34,34,34,24,34,24,34, 24,34,24,34,34,34,34,34,1,24,1,43,51,51,43,24,43,24,43,34, 24,34,34,1,34,34,43,43,43,24,24,43,43,24,43,43,43,43,24,43, 1,1,1,51,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,1,24,1, 24,43,34,1,1,51,24,43,43,43,51,24,51,43,43,43,43,51,24,1, 51,43,43,43,43,13,13,13,13,13,1,13,1,1,1,34,1,1,1,1, 13,1,13,13,13,34,13,1,1,1,1,1,43,13,1,1,1,1,13,24, 13,13,13,13,13,13,13,43,13,13,13,13,13,24,24,34,34,13,34,13, 13,13,13,13,43,43,13,13,24,24,1,1,1, }; static unsigned short stb__arial_12_latin1_a[224]={ 48,48,61,96,96,153,115,33, 57,57,67,100,48,57,48,48,96,96,96,96,96,96,96,96, 96,96,48,48,100,100,100,96,174,115,115,124,124,115,105,134, 124,48,86,115,96,143,124,134,115,134,124,115,105,124,115,162, 115,115,105,48,48,48,81,96,57,96,96,86,96,96,48,96, 96,38,38,86,38,143,96,96,96,96,57,86,48,96,86,124, 86,86,86,57,45,57,100,129,129,129,129,129,129,129,129,129, 129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129, 129,129,129,129,129,129,129,129,48,57,96,96,96,96,45,96, 57,127,64,96,100,57,127,95,69,94,57,57,57,99,92,48, 57,57,63,96,143,143,143,105,115,115,115,115,115,115,172,124, 115,115,115,115,48,48,48,48,124,124,134,134,134,134,134,100, 134,124,124,124,124,115,115,105,96,96,96,96,96,96,153,86, 96,96,96,96,48,48,48,48,96,96,96,96,96,96,96,94, 105,96,96,96,96,86,96,86, }; // Call this function with // font: NULL or array length // data: NULL or specified size // height: STB_FONT_arial_12_latin1_BITMAP_HEIGHT or STB_FONT_arial_12_latin1_BITMAP_HEIGHT_POW2 // return value: spacing between lines static void stb_font_arial_12_latin1(stb_fontchar font[STB_FONT_arial_12_latin1_NUM_CHARS], unsigned char data[STB_FONT_arial_12_latin1_BITMAP_HEIGHT][STB_FONT_arial_12_latin1_BITMAP_WIDTH], int height) { int i,j; if (data != 0) { unsigned int *bits = stb__arial_12_latin1_pixels; unsigned int bitpack = *bits++, numbits = 32; for (i=0; i < STB_FONT_arial_12_latin1_BITMAP_WIDTH*height; ++i) data[0][i] = 0; // zero entire bitmap for (j=1; j < STB_FONT_arial_12_latin1_BITMAP_HEIGHT-1; ++j) { for (i=1; i < STB_FONT_arial_12_latin1_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_arial_12_latin1_BITMAP_WIDTH; float recip_height = 1.0f / height; for (i=0; i < STB_FONT_arial_12_latin1_NUM_CHARS; ++i) { // pad characters so they bilerp from empty space around each character font[i].s0 = (stb__arial_12_latin1_s[i]) * recip_width; font[i].t0 = (stb__arial_12_latin1_t[i]) * recip_height; font[i].s1 = (stb__arial_12_latin1_s[i] + stb__arial_12_latin1_w[i]) * recip_width; font[i].t1 = (stb__arial_12_latin1_t[i] + stb__arial_12_latin1_h[i]) * recip_height; font[i].x0 = stb__arial_12_latin1_x[i]; font[i].y0 = stb__arial_12_latin1_y[i]; font[i].x1 = stb__arial_12_latin1_x[i] + stb__arial_12_latin1_w[i]; font[i].y1 = stb__arial_12_latin1_y[i] + stb__arial_12_latin1_h[i]; font[i].advance_int = (stb__arial_12_latin1_a[i]+8)>>4; font[i].s0f = (stb__arial_12_latin1_s[i] - 0.5f) * recip_width; font[i].t0f = (stb__arial_12_latin1_t[i] - 0.5f) * recip_height; font[i].s1f = (stb__arial_12_latin1_s[i] + stb__arial_12_latin1_w[i] + 0.5f) * recip_width; font[i].t1f = (stb__arial_12_latin1_t[i] + stb__arial_12_latin1_h[i] + 0.5f) * recip_height; font[i].x0f = stb__arial_12_latin1_x[i] - 0.5f; font[i].y0f = stb__arial_12_latin1_y[i] - 0.5f; font[i].x1f = stb__arial_12_latin1_x[i] + stb__arial_12_latin1_w[i] + 0.5f; font[i].y1f = stb__arial_12_latin1_y[i] + stb__arial_12_latin1_h[i] + 0.5f; font[i].advance = stb__arial_12_latin1_a[i]/16.0f; } } } #ifndef STB_SOMEFONT_CREATE #define STB_SOMEFONT_CREATE stb_font_arial_12_latin1 #define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_arial_12_latin1_BITMAP_WIDTH #define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_arial_12_latin1_BITMAP_HEIGHT #define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_arial_12_latin1_BITMAP_HEIGHT_POW2 #define STB_SOMEFONT_FIRST_CHAR STB_FONT_arial_12_latin1_FIRST_CHAR #define STB_SOMEFONT_NUM_CHARS STB_FONT_arial_12_latin1_NUM_CHARS #define STB_SOMEFONT_LINE_SPACING STB_FONT_arial_12_latin1_LINE_SPACING #endif