• Advertisement
Sign in to follow this  

Big Font with glBitmap ?

This topic is 4874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to display text (mainly numbers) with glBitmap, I am using an array containing the pixel data, but the text displayed is too small. How can I make it large MY CODE static GLubyte Font[][14] = { { 32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 33, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 }, ...................... ...................... { 125, 0x00, 0x00, 0xf0, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x1c, 0x18, 0x18, 0x18, 0xf0 }, { 126, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00 } }; ----------------------------------------------------------------- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes); glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst); glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength); glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows); glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels); glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); for(i=0;i<len;i++) { unsigned char ch = str; if(ch==0) /* end of string */ break; if(ch < 32) continue; if(ch > 126) continue; ch -= 32; glBitmap(8, 13, 0.0, 1.0, 15.0, 0.0, &Font[ch][1]); } glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst); glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength); glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); ----------------------------------------------------------------- Thank you in Advance

Share this post


Link to post
Share on other sites
Advertisement
I think glPixelZoom won't work with glBitmap, but you can try it and see if it does. Otherwise, you have to make a new font and fill the Font array with the new data. The data you have is a fixed size font (looks like a 8x13 font), so if you want a larger font, you have to make a new bitmask.

Share this post


Link to post
Share on other sites
Paint Shop Pro can export 1-bit bitmaps, so just paint your letters there, save the images and load them in your program. A format specification for the BMP format can be fount here.

But there probably exists some program designed for this already, but I don't know. Search Google and see if you can find something.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement