// 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_times_bold_17_usascii_*, // and separately install each font. Note that the CREATE function call has a // totally different name; it's just 'stb_font_times_bold_17_usascii'. // /* // 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_times_bold_17_usascii_BITMAP_WIDTH 128 #define STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT 88 #define STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT_POW2 128 #define STB_FONT_times_bold_17_usascii_FIRST_CHAR 32 #define STB_FONT_times_bold_17_usascii_NUM_CHARS 95 #define STB_FONT_times_bold_17_usascii_LINE_SPACING 11 static unsigned int stb__times_bold_17_usascii_pixels[]={ 0x06201098,0x0402602a,0x33100cc0,0x44026621,0x008800aa,0x01331000, 0x02004110,0x19afd406,0x10741d50,0x5c06607d,0x40ba89bb,0x17f53fa8, 0xddaaed88,0x2ccdb980,0x0fd4ffee,0x376abb62,0x5db7bb00,0x27f67fcc, 0x45b109f7,0x0749f03b,0x6c0ee0f7,0x7f102a01,0x1ff107ea,0x2ba07f44, 0x9ff4599a,0x107fc438,0x3a7d81ff,0xfda7f42f,0x7c00bf92,0xc83a5f82, 0x6c07cc0f,0x3e21c041,0x5fd83f53,0x33e65fc8,0x76fa851a,0xfc85fd81, 0x2fd9be25,0x55fb8ff4,0xd8bfb07f,0x41d1fc44,0x5c3641fb,0x4ff2fa22, 0x1fa9fc42,0x3ea13fe2,0x03fff10f,0x3e21cff4,0x50ffb84f,0x3a17ecbf, 0x3e6df51f,0x3ec5fa81,0x2a0e8be2,0x86c3740f,0x223fd4e8,0x0fd4fe21, 0xff505ff5,0x817ffd45,0x7fd42efb,0xf32ffa82,0x3fa17ecf,0x407cbf71, 0x20fe45fa,0x3621d0da,0x9342fc43,0x2099fe3f,0x4c3f53f8,0x0ffa82ff, 0x441fff44,0x82ff987f,0x43fe0ffa,0xc97f42fe,0x2fd4162f,0x752e0bee, 0x89f30790,0x27d5fe49,0x3f53f885,0x6fb83fe8,0x320dfd50,0xf707fd04, 0xfeced98d,0x27eeff42,0x322fd406,0x41d2640f,0xa445f85b,0x145fb5f9, 0x20fd4fe2,0x23fc84fb,0x01fb3508,0x213ee015,0x3f6103fc,0x4044ff42, 0x6d8bf500,0x541d17c4,0x9ac36c1f,0x270fccef,0x0fd4fe20,0xdf883f62, 0x2e4d5260,0xfe880eb3,0xb003be20,0x501fe85f,0xe8bf509f,0x41d27c44, 0x643dc1fb,0x57d31dd0,0xf53f88a2,0x3b33aa03,0xcccde882,0x20073ea0, 0x004dbcec,0x17fc47fd,0x5fa83fa8,0xe97e07e2,0x07e21f20,0xf10a0091, 0xe8807ea7,0x80dc404f,0x00088000,0x99886662,0xf3910201,0x23f80dc9, 0x2441ee0e,0x107101d4,0x1007ea7f,0x000017ff,0x00000000,0x87dfcc00, 0x744c8809,0x82806640,0xaaa99ab8,0xea975c40,0x6ed4400c,0x00000003, 0x20000000,0x05400018,0x00620000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x050c4000,0x0140c403,0x0288004c, 0x1020a980,0x01013333,0x33102662,0x26201301,0x22013009,0x99629501, 0x81d82e8f,0xd75d501d,0x0fe5e403,0x76567e40,0x5ffe441e,0x3bf6baa0, 0x445ffb11,0x220680dc,0x657442fe,0x2c81fe84,0x46ebe495,0x3a07503b, 0x47cc17e6,0x17ec03f8,0x3fe607e2,0x1fddbe20,0x2983ffe6,0x17ec0598, 0x2e17cdb2,0x26ba620d,0x9f6fd0bc,0x261a2068,0x320dd0ff,0x3200f8af, 0xf303505f,0xfaafd41f,0x877fdcc4,0x2102b828,0xf9b7c2fd,0xeefec805, 0x93af71ef,0x7406c01d,0xf701faff,0x3ff8019d,0x207fcc00,0x9985f76f, 0xd0515ffa,0xfedde981,0x37cdbe62,0x26883ff3,0xb865e447,0xe883b803, 0x3ff203ff,0xff98bf63,0x07fcc002,0x260b2fa2,0x8517ff71,0xfd17e858, 0x7f9b7d45,0x452a0ff4,0x2ee68805,0x6c43441c,0x474c3ffd,0x98591ffb, 0x7cc002ff,0x2601640f,0x70afff61,0x3f66f887,0x3fcdbea2,0xfffd87fa, 0x47602fff,0x0e86c9fa,0x237ed3e2,0x127bf66e,0x26001ffc,0x777fc0ff, 0x3fa0cc2c,0x3ea06c2f,0x6f98bf66,0x41fe8df3,0x3b80591d,0x703f23f2, 0x7f89fd45,0x7fc43fe6,0x00dfb00f,0x70ff31f9,0x4c1fffff,0xd117fc41, 0x17ecdf10,0xd17e6df1,0x8076783f,0x3e47dc68,0x7c9f12cc,0xfc8f7fc4, 0x7f444aef,0x51f92c43,0x261e98df,0x3e60aa1f,0x47f40ea2,0xabe42fe8, 0xb10ff41f,0xd107603c,0xa83a07d5,0x7540cbad,0xffe9aeff,0xcceec880, 0x3b6f620c,0x5ccdf440,0x2e07ba64,0x76c40762,0xdbd84fed,0x8227fcc3, 0x09806200,0x44004020,0x01100180,0x0ccc0088,0x20020800,0x00008010, 0x00000000,0x00000000,0x00000000,0x10000000,0x40260033,0x18019998, 0x00ccccc4,0x31043531,0x26621333,0x3010a980,0x4c409801,0x46662199, 0x99889998,0x10331099,0x7f4c03ff,0x6fffe84f,0xfe817930,0x6440ffff, 0x24deb9cf,0x910affc8,0x6d56cc1b,0x13a7a61e,0x4c3be6ea,0x3ea21eff, 0x711bff32,0x132219ff,0x73b00ff4,0x7774c1ff,0x881f982e,0x445eeeff, 0x544e81fe,0x3614c0ff,0x75f88ec3,0x9f94e87f,0x0e607fe4,0x44ff8dfb, 0x023fd00b,0x0720fe81,0x06a09f30,0x105fc85b,0x4c0ffa89,0x1983be22, 0x91beabf5,0xff893ee7,0x0ffcc243,0x3a048ff9,0xf105fccf,0x80dfff85, 0x4400abfd,0x80ffe20f,0x2607fd40,0x541fffc2,0x6c0ff36f,0x7137e41f, 0xffc97fa0,0x97f40332,0x6ff543fc,0x1fffff30,0x02febff8,0x05ff316a, 0x2607fd40,0x0f7ffcc2,0x41fe2ff1,0x2ff980e8,0x23fee017,0x8095fdb8, 0x88bf71fe,0x75cc3ffc,0x7d5be64f,0xff30f606,0x20999985,0x414c0ffa, 0x2e1fffd8,0x1705fddf,0x204afec0,0xfa8bbff8,0x8ff4039f,0x0bf706fa, 0x22df53ec,0xf01f00ff,0x0dff887f,0x43503fe6,0x117faa08,0x00607f93, 0xc8019ff5,0x03bfe4ef,0x13ee3fd0,0x4b5017c4,0x541fe7f8,0xfd0bfb06, 0x5c1ff889,0x0bf11261,0xe800817a,0x2ff9805f,0x3fa017f2,0x432a3f71, 0x2b8b6668,0x827c4fec,0x85fd103d,0x43fe84fe,0x07e07cc4,0x03fa8176, 0x6e800fdc,0x674017cc,0x3fee2ead,0x37fa209b,0x0b7bb01b,0x33b2007c, 0xe881dfba,0x6cc0ccdf,0x5d43cacd,0x201fd402,0x20ee0068,0x8020800e, 0x44004400,0x31000c00,0x8800c001,0x00400080,0x00800008,0x00000000, 0x00000000,0x00000000,0x00000000,0x26662088,0x31099999,0x26661333, 0x01333310,0x22009988,0x44009999,0x8026620a,0x33009998,0x4cccc433, 0x13333100,0x98826662,0x33ee1d81,0x14ebcffb,0x3e617ffd,0x97ff910c, 0x5fd105fd,0x6dffdc40,0x0fcdc84f,0x64405fd1,0xfff985ff,0x02fff221, 0x885ffdc4,0x3fe20bfb,0x12b87f21,0xf89225ff,0x3ea12a5f,0x3607fe67, 0x87fcc02f,0x233e62fe,0x26017ec3,0x7ee40ffd,0x400ff985,0x80ec1ff9, 0xbdff71fe,0x062ff886,0x20917ff7,0x41ff47f9,0x3e6012fd,0x7dcbf90f, 0x9805fb04,0x7e5c4ffa,0x400ff985,0x01911ff9,0x03fb0ff4,0xfb00bfe2, 0x1fe6019f,0xb9fb03ff,0x21ff30bf,0x7ffd54fe,0x0ff25fb0,0x454ff733, 0x0ff985fc,0x24cffcc0,0x3fb0ff40,0x100bfe20,0x7fcc0bff,0xfb04fd99, 0xff307fa9,0x7dc1bf75,0x0725fb04,0xa4ffe266,0x0ff985fc,0x77e7fcc0, 0xfb0ff400,0x00bfe203,0x7cc0fff2,0x3604ffbf,0xf983fb2f,0x4fb809bf, 0x20595fb0,0x253df919,0x0ff985fc,0x7fdffcc0,0xfb0ff405,0x00bfe203, 0x301ffb53,0x407feeff,0x985fb2fd,0x13ee00ff,0x9837f7ec,0x7e4bff31, 0x180ff985,0x3fea7fe6,0xfd87fa04,0x02ff881a,0x42ffc522,0x03ff67f9, 0x217ecbf6,0x3ee00ff9,0x9fb5fb04,0x91ff4330,0x81ff30bf,0x647fe638, 0x43fd02ff,0xff882ef9,0xffa8b102,0xf887fd43,0xfb2fd85f,0x200ff985, 0x15fb04fb,0x2a2985ff,0x2617f60f,0xf31e41ff,0x40fff43f,0xf91001fe, 0x2eea83bf,0x6ccfffee,0x9ff50cff,0x3e77fa21,0x33ff265f,0x41efd881, 0x3ffb5ff8,0x2a487766,0x3f662ffe,0x12feccdf,0x3f619ff9,0x13fe63ff, 0x00000000,0x00000000,0x00000000,0x20000000,0x99999998,0x11333310, 0x26213333,0x884cc199,0x09999999,0x33333331,0x00cccc41,0x44266662, 0x20009999,0x20103000,0x76c28009,0x226ffaab,0xfb88bffb,0x3ffd30bf, 0xff711fa8,0x2e2dd757,0x26fcabff,0xdecbffc8,0x85ffdc40,0xefcbffc8, 0xd5007401,0x3e63fb8f,0x83ee04ff,0x30bfee0d,0x0ffcc3ff,0x8550bfea, 0xf32c1ff9,0x3ea2c41f,0xf303be67,0x70ff983f,0x81fcc0ff,0x27dc7fca, 0x303ffb7d,0xff1141ff,0x4c3ff30b,0x46fd81ff,0x231ff984,0x2943fe62, 0x1bf63fd4,0xff981ff3,0x3601ff50,0x21fe606f,0x82ff8220,0xffb00ffc, 0x4c3ff301,0x3ff981ff,0x23ff3017,0x488ff984,0xffc8ff50,0xf303fe60, 0x4c17f21f,0xff102ffc,0x640fd800,0xffa80ff8,0x99bff303,0x3f203ffb, 0x7ff3039f,0xd9ff30f9,0xf51fea09,0x207fcc5f,0x02fedff9,0xf8837ed2, 0x513e0087,0x3fa03fe5,0x26bfe606,0xf101ffa9,0x57fcc0df,0xcaff987b, 0xfa8ff504,0x303fe62f,0x0bfb31ff,0x207fea71,0x427e47f8,0x1ff2446a, 0x30c1ffc8,0x0ffcc3ff,0x7cc0bfb0,0x1ff30b1f,0x51fea08e,0x07fcc1ff, 0x7fc43fe6,0x7fd55dc2,0x7e47f885,0x3b207446,0x3e66ffee,0x3fe6584f, 0xd807fe61,0x47fe605f,0x210ff981,0xf91fea39,0x4c0ff98b,0x90ffe0ff, 0x81ff7333,0x0c8907f8,0x7ff775ce,0xb903ff66,0xff30ffcc,0x302fec03, 0x7fcc03ff,0xffa87621,0xf981df30,0xa87fcc1f,0x3e06e0ff,0x5c3fcc4f, 0x13fffee1,0xeffa87fc,0x914feccc,0xff9119ff,0xfffa8819,0x67fe440a, 0xcdffc980,0xffb30ffd,0xf9307ddb,0x3ff6619f,0x3ee0bdcd,0x4fffea0c, 0x130bffc9,0x1fffffd4,0x00000ff8,0x00000000,0x00000000,0x00000000, 0x00020000,0x00000040,0x08008042,0x80880080,0x8010001a,0xe8800041, 0x27fee4fb,0x2e7b3ff9,0x267ff74f,0xf35ff31f,0x46ccc83f,0xd102dac8, 0x426de440,0x7545eada,0x2bfa202e,0xb9fd13fc,0x41ffb3df,0x23e8dff9, 0x7f41f96d,0xfb8e7fd2,0x21c4ffa4,0x4c3fd2fd,0xd76d893f,0x36d81a20, 0x5f95f89f,0x9039f930,0x7ec3b5bf,0x0feebf94,0x7c473ff5,0x8dfb8514, 0x540876fc,0x2fd8176f,0x67fc43fd,0x0fdcefc0,0x16f88344,0x7fb3c8df, 0x90ef5c40,0x64bf209f,0xfb09f73f,0x2205fa8b,0x1bfe8bff,0xd839fe80, 0xfc83fd2f,0x2677ea5f,0x9f999509,0x457ea399,0x3fddb87f,0xc833f220, 0x325f903f,0xf309f73f,0x007fc41f,0x21bee9fb,0xd80efb81,0xa843fd2f, 0x20ff11ff,0xaaafbaa9,0x1be2bf11,0x2a0ff2db,0x2fc80bed,0x4ff25f90, 0x4fe884fb,0x204c67f4,0xb87f11fa,0xc82fc44f,0x261ff8af,0xa7f43f53, 0x3606880a,0x77c47f36,0x37aa3fe9,0xd817ec01,0x3ee7f93f,0x0ffc6444, 0x1a07ff91,0xc83fa81d,0xfd9ff302,0x22e674c9,0xd102fff9,0x42ede440, 0x50efaaee,0x1bfd1001,0xfe8dfe88,0xb30efd8e,0x081dff19,0x80402040, 0x08800800,0x00d10020,0x00000011,0x00000000,0x00000000,0x00000000, 0x41100000,0x9911aaa9,0x00799999,0xa8000000,0x01300201,0x2020c414, 0x22b98621,0xeeeeeeeb,0xff1080c2,0x552fffe4,0x00355555,0xf77d5000, 0x37ae205f,0xbfd9fd11,0x1f981f40,0x26f987f4,0x6d8ff2fb,0x26666662, 0x39fdd109,0x3137c42a,0x00000333,0x5fc85400,0xd80cfc98,0x9c83fd4f, 0x36742a9b,0x8ffcc3fa,0x1b0fd2fb,0x2aaaaaa6,0x7fdc450a,0x00000004, 0x1ff98000,0xfb00bbaa,0x9bb07f65,0x2da5c5d7,0x0f9921b2,0xcccb80bb, 0x0002cccc,0x00000000,0xd989fd00,0x4bf600be,0x0cba82fd,0x9334c3a2, 0x07534398,0x00000000,0x00000000,0x91021df5,0x25fb039f,0x64fc42fd, 0x0c790f26,0x00445031,0x00000000,0x20000000,0x40532ff8,0x4bf61eea, 0x031182fd,0x00000000,0x00000000,0xf9000000,0x3003fb7f,0x3e77fe23, 0x0000005f,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, }; static signed short stb__times_bold_17_usascii_x[95]={ 0,1,1,0,0,1,0,1,0,0,0,0,0,0, 0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,-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,0,0, }; static signed short stb__times_bold_17_usascii_y[95]={ 13,2,2,2,2,2,2,2,2,2,2,3,10,8, 10,2,2,2,2,2,2,2,2,2,2,2,5,5,4,6,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,15,2,5,2,5,2,5,2,5,2,2, 2,2,2,5,5,5,5,5,5,5,3,5,5,5,5,5,5,2,2,2,7, }; static unsigned short stb__times_bold_17_usascii_w[95]={ 0,3,7,8,8,14,13,3,5,5,7,9,4,5, 4,5,8,6,7,7,8,8,8,8,8,8,3,3,9,9,9,7,14,11,10,11,11,10,9,12,12,6,8,13, 10,15,11,12,9,12,12,8,10,11,11,16,11,11,10,4,5,4,7,9,4,8,8,7,9,7,7,8,9,5, 5,9,5,13,9,8,8,9,7,6,5,9,8,11,8,8,7,5,2,5,9, }; static unsigned short stb__times_bold_17_usascii_h[95]={ 0,12,6,12,13,12,12,6,15,15,7,9,6,3, 4,12,12,11,11,12,11,12,12,12,12,12,9,11,8,4,8,12,15,11,11,12,11,11,11,12,11,11,12,11, 11,11,12,12,11,14,11,12,11,12,12,12,11,11,11,14,12,14,7,2,4,9,12,9,12,9,11,12,11,11, 15,11,11,8,8,9,12,12,8,9,11,9,9,9,8,12,8,15,15,15,4, }; static unsigned short stb__times_bold_17_usascii_s[95]={ 126,122,54,1,72,10,40,45,28,7,29, 59,49,92,87,96,112,100,111,10,119,18,27,36,31,79,21,107,9,67,87, 88,34,88,77,54,58,47,37,45,12,70,66,108,97,81,84,90,53,59,30, 70,7,58,96,108,18,25,1,54,25,49,37,98,62,78,1,1,102,51,63, 75,43,121,1,71,122,105,19,69,113,103,97,44,1,34,25,9,119,81,1, 22,19,13,77, }; static unsigned short stb__times_bold_17_usascii_t[95]={ 1,1,77,17,1,17,17,77,1,1,77, 67,77,76,76,17,17,55,55,30,55,30,30,30,17,30,67,55,77,77,67, 30,1,55,55,17,55,55,55,30,55,55,17,43,43,43,17,1,43,1,43, 30,43,30,30,30,43,55,55,1,17,1,77,76,77,67,30,67,17,67,43, 17,43,17,1,43,43,67,77,67,1,1,67,67,43,67,67,67,67,1,77, 1,1,1,77, }; static unsigned short stb__times_bold_17_usascii_a[95]={ 61,82,136,123,123,246,205,68, 82,82,123,140,61,82,61,68,123,123,123,123,123,123,123,123, 123,123,82,82,140,140,140,123,228,177,164,177,177,164,150,191, 191,96,123,191,164,232,177,191,150,191,177,137,164,177,177,246, 177,177,164,82,68,82,143,123,82,123,137,109,137,109,82,123, 137,68,82,137,68,205,137,123,137,137,109,96,82,137,123,177, 123,123,109,97,54,97,128, }; // Call this function with // font: NULL or array length // data: NULL or specified size // height: STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT or STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT_POW2 // return value: spacing between lines static void stb_font_times_bold_17_usascii(stb_fontchar font[STB_FONT_times_bold_17_usascii_NUM_CHARS], unsigned char data[STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT][STB_FONT_times_bold_17_usascii_BITMAP_WIDTH], int height) { int i,j; if (data != 0) { unsigned int *bits = stb__times_bold_17_usascii_pixels; unsigned int bitpack = *bits++, numbits = 32; for (i=0; i < STB_FONT_times_bold_17_usascii_BITMAP_WIDTH*height; ++i) data[0][i] = 0; // zero entire bitmap for (j=1; j < STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT-1; ++j) { for (i=1; i < STB_FONT_times_bold_17_usascii_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_times_bold_17_usascii_BITMAP_WIDTH; float recip_height = 1.0f / height; for (i=0; i < STB_FONT_times_bold_17_usascii_NUM_CHARS; ++i) { // pad characters so they bilerp from empty space around each character font[i].s0 = (stb__times_bold_17_usascii_s[i]) * recip_width; font[i].t0 = (stb__times_bold_17_usascii_t[i]) * recip_height; font[i].s1 = (stb__times_bold_17_usascii_s[i] + stb__times_bold_17_usascii_w[i]) * recip_width; font[i].t1 = (stb__times_bold_17_usascii_t[i] + stb__times_bold_17_usascii_h[i]) * recip_height; font[i].x0 = stb__times_bold_17_usascii_x[i]; font[i].y0 = stb__times_bold_17_usascii_y[i]; font[i].x1 = stb__times_bold_17_usascii_x[i] + stb__times_bold_17_usascii_w[i]; font[i].y1 = stb__times_bold_17_usascii_y[i] + stb__times_bold_17_usascii_h[i]; font[i].advance_int = (stb__times_bold_17_usascii_a[i]+8)>>4; font[i].s0f = (stb__times_bold_17_usascii_s[i] - 0.5f) * recip_width; font[i].t0f = (stb__times_bold_17_usascii_t[i] - 0.5f) * recip_height; font[i].s1f = (stb__times_bold_17_usascii_s[i] + stb__times_bold_17_usascii_w[i] + 0.5f) * recip_width; font[i].t1f = (stb__times_bold_17_usascii_t[i] + stb__times_bold_17_usascii_h[i] + 0.5f) * recip_height; font[i].x0f = stb__times_bold_17_usascii_x[i] - 0.5f; font[i].y0f = stb__times_bold_17_usascii_y[i] - 0.5f; font[i].x1f = stb__times_bold_17_usascii_x[i] + stb__times_bold_17_usascii_w[i] + 0.5f; font[i].y1f = stb__times_bold_17_usascii_y[i] + stb__times_bold_17_usascii_h[i] + 0.5f; font[i].advance = stb__times_bold_17_usascii_a[i]/16.0f; } } } #ifndef STB_SOMEFONT_CREATE #define STB_SOMEFONT_CREATE stb_font_times_bold_17_usascii #define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_times_bold_17_usascii_BITMAP_WIDTH #define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT #define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_times_bold_17_usascii_BITMAP_HEIGHT_POW2 #define STB_SOMEFONT_FIRST_CHAR STB_FONT_times_bold_17_usascii_FIRST_CHAR #define STB_SOMEFONT_NUM_CHARS STB_FONT_times_bold_17_usascii_NUM_CHARS #define STB_SOMEFONT_LINE_SPACING STB_FONT_times_bold_17_usascii_LINE_SPACING #endif