PDA

View Full Version : Text Rendering



Dtag
04-11-2003, 11:42 AM
Hi..
Iam looking for a good way to render text. I dont want it to have a fixed size so every character can be different. The usual wglUseFontBitmaps just creates fixed size letters, which I dont want.
I also need to be able to do word wrapping so i need the size of every single character
thx http://www.opengl.org/discussion_boards/ubb/smile.gif

pinkxp
04-11-2003, 11:48 AM
I found very useful the fonts tutorials on this site :
http://nehe.gamedev.net/
check it out


Originally posted by Dtag:
Hi..
Iam looking for a good way to render text. I dont want it to have a fixed size so every character can be different. The usual wglUseFontBitmaps just creates fixed size letters, which I dont want.
I also need to be able to do word wrapping so i need the size of every single character
thx http://www.opengl.org/discussion_boards/ubb/smile.gif

shinpaughp
04-11-2003, 11:50 AM
Look at http://www.opengl.org/developers/faqs/technical/fonts.htm . You probably want one of the font libraries, which may have what you are looking for, or you may have to use the wgl font funcs to load each character as you are going by changing the current font using CreateFont or similar and SelectObject, and then calling the wgl font func to load the characters you need.

There is also wglUseFontOutlines which can be used to create almost any true type or similar windows non bitmap font.

[This message has been edited by shinpaughp (edited 04-11-2003).]

Dtag
04-11-2003, 11:57 AM
I need a library that can predict the length of a text without using GDI functions ( theire damn slow ) ( looking at those links now http://www.opengl.org/discussion_boards/ubb/smile.gif )

Dtag
04-11-2003, 12:04 PM
The tutorial on NeHe uses the same technique as I am using atm. I would need to use GDI functions to get the width of a text properly