Archived

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

suliman

how to use Fonts plz?

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:

CreateFont

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!!!!!!!):

SelectObject

For writting to screen:

DrawText
DrawTextEx
TextOut

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

SelectObject

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

DeleteObject

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