Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


how to use Fonts plz?

This topic is 5176 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

Hi Is there any way or already-built functions for drawing fonts? I know there is something called .abc files where you have the font rendered down as an image and i got thet to work, but then what? Is there any tutorial or any1 got such a system already working? Erik

Share this post

Link to post
Share on other sites
With the GDI API:

To make a font object:


In order for the font to be used we must select it (store the old font that selectobject returns so we can put it back!!!!!!!):


For writting to screen:


Now we are dont with the font place the old font back :


If you don't want the font anymore delete it!:


Search for the function parameters on MSDN too much to type out or copy/paste/format.

p.s GDI is very slow due to the GetDC stuff you need. So you are best writting the text to surface or texture then displaying that. Or better yet write all letters down before hand and then drawing them to screen during run time (although if you draw one letter at a time expect a large overhead cost).

[edited by - Drazgal on May 20, 2004 7:46:48 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!