// 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_courier_bold_9_latin1_*, // and separately install each font. Note that the CREATE function call has a // totally different name; it's just 'stb_font_courier_bold_9_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_courier_bold_9_latin1_BITMAP_WIDTH 256 #define STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT 36 #define STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT_POW2 64 #define STB_FONT_courier_bold_9_latin1_FIRST_CHAR 32 #define STB_FONT_courier_bold_9_latin1_NUM_CHARS 224 #define STB_FONT_courier_bold_9_latin1_LINE_SPACING 4 static unsigned int stb__courier_bold_9_latin1_pixels[]={ 0x80002000,0x03013009,0x10810800,0x30088030,0x40000000,0x0002db80, 0x0c4080c4,0x00040400,0x04001802,0x0018b808,0x18080008,0xd1fc1888, 0x87712205,0x288382bb,0xb2ec2ab8,0xa85150ec,0xb1155c28,0x19028838, 0x502e8d2c,0x5d41709d,0x20aee0c8,0x220e60e8,0x2bb82c43,0x6c2441c4, 0x1441cc0d,0x20e20de4,0x21b9d438,0x44d33cdb,0x5dc2bb83,0x95713ee3, 0x51665458,0x6dc586e7,0x64b67722,0xb3b92d9d,0x32596585,0x0b6e2d9d, 0xb71645b7,0x3222db85,0x2a2b962c,0x225cc1cc,0x239961ca,0x86e541ca, 0x0e541cb8,0x43971072,0x32e21cb8,0x9a8ef261,0x4b632e39,0x266a399a, 0x2950e543,0x25f3750e,0x95072a68,0x1b245443,0xb076f445,0x952d9da8, 0x1750e83a,0xa8e4aa1b,0x0e4aa392,0x954b3596,0x21b1751c,0x21d0d8ba, 0x1750d8ba,0x47254c1b,0x43676a49,0x3950fbd9,0xa8dc721b,0xd3950d9c, 0x3952dd41,0x5d42c41b,0x2ea2dd45,0xba933265,0xa9636258,0x962ea58b, 0x2b60eaca,0x44eb6364,0x2a1d5956,0x99530eac,0x12f61edc,0x6c554a8b, 0x2658744a,0x95472553,0xb072551c,0x64aa59ac,0x2659ccb1,0x96732cd3, 0x4c324439,0x1b954ea4,0x895c721b,0x95c724de,0x2f6a1b0c,0x3215c726, 0xda9af6a0,0x99af6a6b,0x16710d8b,0x259c41f5,0x666e4b38,0x9db83e61, 0x666e4a1b,0x26399b91,0x996535ca,0x3aa2c6ef,0x9607cc4d,0x64ea371b, 0x9d432750,0x52cb2c0c,0x1b8dc327,0xb8e46e37,0x0dc6e371,0xe8ee5922, 0x9bb10dde,0x3ba2ef44,0x4cbbd12d,0xfbb54fdd,0x26177a25,0x54bf76a4, 0xfbb52fdd,0xe897b725,0x3a22c2fd,0x5fbd12fd,0x5447b762,0x4e26f5c4, 0xbb11edd8,0xd985223d,0x3a156c2f,0x12a20ee2,0x126ec495,0x26ec49bb, 0x25b89bb1,0x26ec47a5,0x6ec49bb1,0x26ec5624,0x4a889bb1,0x00080e96, 0x00808404,0x12008001,0x40000000,0x080004fd,0x800a265c,0x83930100, 0x04c0ab84,0x43cb8399,0x80000000,0x00088208,0x10000800,0x00104179, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x88000000,0x05000180,0x01018002,0x79300001,0x266a1a81, 0x802145c3,0x2bb80001,0x0a2e0008,0x00000aee,0x0c060210,0x18084044, 0xb7011030,0x40620039,0x00880008,0x3aa1440e,0x65c5887e,0x2341ee45, 0x9bd10dd9,0xdf06eec4,0x70e4ecc9,0x12c5d457,0x30298397,0x37622ec4, 0x514d5dc3,0x3950f603,0x572abab8,0x6ec2bb80,0x2ae14544,0xa8381442, 0x22155c28,0x573b8702,0x414c26e4,0x65c409a8,0x6cc0bb80,0x1605d985, 0x209e98ae,0x26cd8b48,0x55cd101d,0x0aa1743b,0x1671065c,0x902b8b75, 0xb8d188b0,0x20ae28bb,0x3ab2a3da,0x28944ae0,0x2d9ad835,0x5dd89a91, 0xdd897762,0xdb977625,0x1bbb70dd,0x6dc3776e,0xdac0b0dd,0x36617660, 0xd985d985,0xd903d905,0xa8b07503,0x864a63ba,0x177e2139,0x1e644bb1, 0x3bbb16f2,0xde8876f4,0x98d7b52f,0x82c16c45,0x1556643c,0x6473b0b3, 0x2ab21ccd,0x83999529,0x3fa1c8fa,0x42c42c45,0x64c58858,0x173930b9, 0x64c2e726,0xb04390b9,0x81ec83f9,0x81ec81ec,0x849e81ec,0x540d849e, 0x931cca83,0xcb4b9b16,0x81dc0d80,0x3761620c,0xda81910f,0x3222c2fd, 0x41ec2c49,0x4c583ac8,0x3b7626ee,0x170ef221,0x0bdba879,0x2c161693, 0x7e88b058,0x1fa23f44,0xedd88fd1,0x24f42d41,0x24f424f4,0x37a624f4, 0x03b7a60e,0x91110b0b,0x5c582dd8,0x2177665d,0x1137663b,0x00310205, 0x9506ff4c,0xfb97f625,0xbfd3006e,0x00086d81,0x5d544d88,0xb0bbb10e, 0x4582c160,0x59119ac8,0x466b2233,0x42419ac8,0x76f4c1dd,0x983b7a60, 0x37a60ede,0xd2f57a0e,0x073017ab,0x04003991,0x032ea000,0x00000000, 0x00000000,0xc8000000,0x6c400e8e,0x897f625f,0x97f625fd,0xdd92eeec, 0x4bbbb25d,0x0a22eeec,0x74bd5e80,0x5eaf4bd5,0x0002f57a,0x00000000, 0xdb800000,0x5037661c,0x21ccd479,0x32a4ddd8,0x305d64c1,0x10554179, 0x21bb8397,0x0ed45b4b,0x0000000c,0x00000000,0x00000000,0x1eecc000, 0xa89b7015,0x8af2a1cd,0x5e541cbb,0xca800001,0xd06c5541,0x92ba219b, 0x8dc858ba,0x4c1d5955,0x93b34bfb,0x2dd415c3,0x47443973,0x00081ac5, 0x8b857700,0x4140c5c2,0x0770aee1,0x0edc0000,0x6e446e75,0xb8b67722, 0xd12c41cd,0x50ca4c79,0x74e546a7,0x547276e2,0x20e60f9b,0x50792ed8, 0x57741b39,0xa89d562a,0x642ce25c,0x8733726e,0x0554cfbe,0x4d7b5166, 0x17e459d9,0xccca89f7,0x33220589,0x32a0e540,0x160e66a1,0x710e5c46, 0x5d825417,0x6c5d42dc,0x9c43a950,0x3b8e4aa5,0x36258257,0x2b16ec1a, 0x83637098,0x3432574a,0x47bb10ae,0x5c721cd8,0x9d0e4aa2,0x8977aa3b, 0x3b6a2fde,0x43dbb119,0x3764dfdd,0x376a2c1d,0xd516712f,0x08880d83, 0x215c0b8e,0x3950d9ca,0xa962ea1b,0xba921dfd,0x1911e5c5,0x3ad85835, 0x12b63996,0x2192a932,0x19161705,0x390d8898,0x3bb227b5,0xd893baa0, 0x5e42cc7e,0xe89a7621,0x3277645d,0x400101bf,0x8046efde,0xbfd30200, 0x2e8ec801,0xeefa8ff2,0x9b771141,0xb8e45985,0x9c4ae392,0x2d106c45, 0x2e226bda,0xb07372a3,0xb8dc5dd0,0x50a03e61,0x210e4327,0x6ed42dda, 0x744bbd53,0x2a1c81ed,0x0b0d3103,0x10b38855,0x00000000,0x00000000, 0x44000000,0xe88b0913,0x8977a25d,0x26242fde,0xb85fbb57,0x161645c3, 0x4dd8837a,0x6c2412a2,0x07b7623d,0x98040000,0x2e07323c,0x437fa61c, 0x23b25ee9,0x0000002f,0x00000000,0x00000000,0x3a63e880,0x008040df, 0x1c3ddd70,0x4d362000,0xf5b70dfe,0x004cb805,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x96cedc00,0xbb10dddb,0x80eced4b,0x27bbb509,0x2ecc1cdb,0x6dc18026, 0x05dddc2d,0x45ccae57,0x5c39730b,0x93712b8b,0x03bb8801,0x04092322, 0x02021084,0x22015e54,0x3632e5dd,0x6c5b1972,0x6d363d8c,0x6dc22224, 0x66dca1dd,0x43dd9802,0x8b66b609,0x136e772d,0x4e4c9793,0x2931620b, 0x360cd885,0x1b155498,0x33661ec8,0x6c64c580,0xc8afab60,0xb9d12ccb, 0x5a967661,0x30cee41d,0x226dc41d,0x2ab8fdc6,0x864e43b5,0x472639c8, 0x31fccbd8,0x2ae61ddd,0xd8963625,0x155ce459,0xc8407257,0x64ca2ad8, 0x46c2c0d8,0x8fa82a2b,0x8be3b21c,0x220ef985,0xde98b07e,0x7740f5c7, 0x3a154aa1,0x952ea849,0x1f7a639f,0x74c73b19,0x7117646e,0x0b877b16, 0x32e2cec4,0x297b0a60,0x2a7992bb,0x0ed642bc,0x2bdbc857,0x50b316b1, 0x5c0fa81f,0x2d622cfc,0x4046c210,0x3fa25ce8,0x810ed6c5,0x3320bdba, 0x326162cd,0x066b2249,0x4458c98b,0x504ec0dc,0xede98725,0x1d10f660, 0x5d1dc64c,0x269f8b7d,0x1d92f9fc,0xd507cc5d,0x2618449d,0x21010fef, 0x42a66000,0x02e60a99,0x6fc4bbf5,0x1605c6c6,0xf7f512f6,0x0202cc83, 0xb591588b,0x0d6c2dc8,0x0ebaa8b1,0x158ab672,0x64f23b27,0xbfb12eee, 0x4c17cf64,0xec8bf51d,0x75eaf44e,0xdd912019,0x0000003d,0x00000000, 0x40000000,0x54311102,0x93f60fef,0x5a63f8ec,0x44c3cc0f,0x640ff618, 0x30425b8e,0x3204c1bf,0x753a0e8e,0x007ddf75,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x10000000, 0x2760064c,0x4c733323,0x81011aaa,0x102222c0,0xa893322b,0x0a2e2aaa, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0xba926000, 0x33a67191,0x4447190b,0x155532b8,0x12238922,0x17777629,0x2aa20888, 0x000002aa,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x4326498e,0x30084530,0x00bbbae5,0x00006144,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x40000000,0x001750b9,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, }; static signed short stb__courier_bold_9_latin1_x[224]={ 0,1,1,0,0,0,0,1,2,0,0,0,1,0, 1,0,0,0,0,0,0,0,0,0,0,0,1,1,-1,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0, 0,-1,-1,0,0,0,0,0,0,0,-1,-1,0,0,0,1,0,0,0,-1,1,0,-1,0,0,0,0,0,0,0, 0,0,0,-1,0,0,-1,0,0,0,0,0,0,-1,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,1,-1,1,0,-1,0,-1,-1,1,0,1,1,1,0,0,1,1,1,1,0,0,-1,0,0,-1,-1,-1,-1, -1,-1,-1,0,0,0,0,0,0,0,0,0,-1,-1,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,0,0,0,0,0,0,-1,0, }; static signed short stb__courier_bold_9_latin1_y[224]={ 6,0,1,0,0,1,1,1,0,0,0,1,4,3, 5,0,0,0,0,0,0,0,0,0,0,0,2,2,1,2,1,1,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,0,0,0,0,7,0,2,0,2,0,2,0,2,0,0, 0,0,0,2,2,2,2,2,2,2,1,2,2,2,2,2,2,0,0,0,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,1,6,2,0,1,1,1, 0,0,1,1,0,2,3,3,1,-1,0,0,0,0,0,2,0,2,5,0,0,2,0,0,0,2,-1,-1,-1,-1, -1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,2,0,-1,-1,-1,-1,-1,1,0,0,0, 0,1,1,0,2,2,0,0,0,1,0,0,0,1,0,1,0,0,0,1,1,1,2,0,0,0,1,0,0,1, }; static unsigned short stb__courier_bold_9_latin1_w[224]={ 0,2,3,5,5,5,5,2,2,3,5,5,3,5, 2,5,5,5,5,5,5,5,5,5,5,5,2,3,6,5,5,5,4,6,5,5,5,5,5,5,5,5,5,5, 5,6,6,5,5,5,5,5,5,5,6,6,5,5,5,3,5,3,5,7,3,5,6,5,5,5,5,5,5,5, 4,5,5,6,5,5,6,5,5,5,5,5,5,6,5,5,5,3,2,3,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,5,0,2,4,5,5,5, 2,5,3,6,3,5,6,5,6,7,3,5,3,3,3,5,5,2,3,3,3,5,5,7,5,4,6,6,6,6, 6,6,6,5,5,5,5,5,5,5,5,5,6,6,5,5,5,5,5,4,5,5,5,5,5,5,5,5,5,5, 5,5,5,5,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,5, }; static unsigned short stb__courier_bold_9_latin1_h[224]={ 0,7,3,7,7,6,6,3,8,8,5,5,4,2, 2,7,7,6,6,7,6,7,7,7,7,7,5,5,5,3,5,6,7,5,5,6,5,5,5,6,5,5,6,5, 5,5,5,6,5,7,5,6,5,6,5,5,5,5,5,8,7,8,4,2,3,5,7,5,7,5,6,6,6,6, 8,6,6,4,4,5,6,6,4,5,6,5,4,4,4,6,4,8,8,8,3,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,6,7,5,5,5, 8,7,1,6,4,4,3,2,6,2,3,6,4,4,3,6,7,3,3,4,4,4,6,6,6,6,7,7,7,7, 7,7,5,7,7,7,7,7,7,7,7,7,5,7,8,8,8,8,8,4,7,8,8,8,8,7,5,7,7,7, 7,6,6,7,5,6,7,7,7,6,6,6,6,5,7,5,7,7,7,6,6,5,5,7,7,7,6,8,8,7, }; static unsigned short stb__courier_bold_9_latin1_s[224]={ 255,223,120,249,243,48,175,149,75,98,66, 158,220,163,160,122,134,204,210,151,229,163,145,116,8,68,57,78,126,131,152, 84,238,145,164,96,139,108,133,120,120,114,102,102,96,89,82,72,72,121,60, 114,51,90,38,31,25,19,13,1,151,46,208,169,137,226,102,214,133,201,151, 139,157,145,90,66,60,170,190,163,132,126,202,182,108,188,196,177,184,78,214, 53,50,18,114,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,255,39,140, 244,7,238,95,128,177,241,233,237,124,163,216,152,110,33,106,249,141,181,157, 253,145,102,229,243,248,1,54,199,109,102,95,88,81,74,194,62,56,50,44, 38,32,26,20,14,169,1,78,84,69,22,63,224,217,28,34,40,57,187,176, 175,169,163,157,42,187,139,207,169,226,205,232,235,193,223,9,220,109,232,115, 145,127,15,21,250,1,181,199,193,27,12,5,211, }; static unsigned short stb__courier_bold_9_latin1_t[224]={ 1,1,30,1,1,18,9,30,1,1,25, 24,24,30,30,9,9,9,9,9,9,9,9,9,10,10,25,25,24,30,24, 18,1,24,24,18,24,24,24,17,24,24,17,24,25,25,25,18,25,1,25, 17,25,18,25,25,25,25,25,1,1,1,24,30,30,16,1,16,1,16,17, 17,17,17,1,18,18,24,24,17,17,17,24,16,17,16,24,24,24,18,24, 1,1,1,30,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,1,18,9, 16,25,16,1,9,30,9,24,24,30,30,9,30,30,18,30,24,30,9,9, 24,30,30,24,24,9,18,18,9,9,9,10,10,10,10,16,10,10,10,10, 10,10,10,10,10,16,10,1,1,1,1,1,24,1,1,1,1,1,1,16, 1,1,1,1,18,9,1,16,9,1,1,1,9,9,9,18,16,1,16,1, 1,1,18,18,16,25,1,1,1,18,1,1,1, }; static unsigned short stb__courier_bold_9_latin1_a[224]={ 76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76, }; // Call this function with // font: NULL or array length // data: NULL or specified size // height: STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT or STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT_POW2 // return value: spacing between lines static void stb_font_courier_bold_9_latin1(stb_fontchar font[STB_FONT_courier_bold_9_latin1_NUM_CHARS], unsigned char data[STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT][STB_FONT_courier_bold_9_latin1_BITMAP_WIDTH], int height) { int i,j; if (data != 0) { unsigned int *bits = stb__courier_bold_9_latin1_pixels; unsigned int bitpack = *bits++, numbits = 32; for (i=0; i < STB_FONT_courier_bold_9_latin1_BITMAP_WIDTH*height; ++i) data[0][i] = 0; // zero entire bitmap for (j=1; j < STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT-1; ++j) { for (i=1; i < STB_FONT_courier_bold_9_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_courier_bold_9_latin1_BITMAP_WIDTH; float recip_height = 1.0f / height; for (i=0; i < STB_FONT_courier_bold_9_latin1_NUM_CHARS; ++i) { // pad characters so they bilerp from empty space around each character font[i].s0 = (stb__courier_bold_9_latin1_s[i]) * recip_width; font[i].t0 = (stb__courier_bold_9_latin1_t[i]) * recip_height; font[i].s1 = (stb__courier_bold_9_latin1_s[i] + stb__courier_bold_9_latin1_w[i]) * recip_width; font[i].t1 = (stb__courier_bold_9_latin1_t[i] + stb__courier_bold_9_latin1_h[i]) * recip_height; font[i].x0 = stb__courier_bold_9_latin1_x[i]; font[i].y0 = stb__courier_bold_9_latin1_y[i]; font[i].x1 = stb__courier_bold_9_latin1_x[i] + stb__courier_bold_9_latin1_w[i]; font[i].y1 = stb__courier_bold_9_latin1_y[i] + stb__courier_bold_9_latin1_h[i]; font[i].advance_int = (stb__courier_bold_9_latin1_a[i]+8)>>4; font[i].s0f = (stb__courier_bold_9_latin1_s[i] - 0.5f) * recip_width; font[i].t0f = (stb__courier_bold_9_latin1_t[i] - 0.5f) * recip_height; font[i].s1f = (stb__courier_bold_9_latin1_s[i] + stb__courier_bold_9_latin1_w[i] + 0.5f) * recip_width; font[i].t1f = (stb__courier_bold_9_latin1_t[i] + stb__courier_bold_9_latin1_h[i] + 0.5f) * recip_height; font[i].x0f = stb__courier_bold_9_latin1_x[i] - 0.5f; font[i].y0f = stb__courier_bold_9_latin1_y[i] - 0.5f; font[i].x1f = stb__courier_bold_9_latin1_x[i] + stb__courier_bold_9_latin1_w[i] + 0.5f; font[i].y1f = stb__courier_bold_9_latin1_y[i] + stb__courier_bold_9_latin1_h[i] + 0.5f; font[i].advance = stb__courier_bold_9_latin1_a[i]/16.0f; } } } #ifndef STB_SOMEFONT_CREATE #define STB_SOMEFONT_CREATE stb_font_courier_bold_9_latin1 #define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_courier_bold_9_latin1_BITMAP_WIDTH #define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT #define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_courier_bold_9_latin1_BITMAP_HEIGHT_POW2 #define STB_SOMEFONT_FIRST_CHAR STB_FONT_courier_bold_9_latin1_FIRST_CHAR #define STB_SOMEFONT_NUM_CHARS STB_FONT_courier_bold_9_latin1_NUM_CHARS #define STB_SOMEFONT_LINE_SPACING STB_FONT_courier_bold_9_latin1_LINE_SPACING #endif