Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


How to make 2 different fonts?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Mike00   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 April 2000 - 07:28 AM

In my program, I want two different texts to appear, each a different font. How can I do this? I''m pretty new to openGL Thanks!

Sponsor:

#2 ga   Members   -  Reputation: 126

Like
Likes
Like

Posted 17 April 2000 - 08:57 AM

You can make bitmap fonts in OpenGL using glBitmap().
You can load a font into display lists. With glGenLists(Number_of_letters) allocate enough free display list indices, the function returns the first of them. Then set up the letters into display lists:

glNewList(list_nr,GL_COMPILE)
glBitmap(width,height,0,0,width,0,pointer_to_bitmap_data);
glEndList();

For list_nr you should take the return value of glGenLists() + the ASCII code of the letter. The bitmap is a real bitmap, I mean every bit represents one pixel.

This was the initialization, if you want to write use glRasterPos2i(x,y) to set the ''cursor'' to the right position, then:

glListBase(listbase);
glCallLists(str_length,GL_UNSIGNED_BYTE,pointer_to_str);

If you want to use two different fonts, make the initializasion a second time for the second font, then you can choose with glListBase() which font you want.

Visit our homepage: www.rarebyte.de.st

GA

#3 Mike00   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 April 2000 - 10:05 AM

Thanks, but I meant in outline fonts, like in lesson 14...

#4 ga   Members   -  Reputation: 126

Like
Likes
Like

Posted 17 April 2000 - 10:49 AM

Create the two fonts with CreateFont(), call wglUseFontOutlines() two times but before you call it the 2nd time select the second font object, then call it with a different base.
Then you have the possibility to choose between the two fonts with glListBase()

Visit our homepage: www.rarebyte.de.st

GA




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS