PDA

View Full Version : Font size - cell vc character



Al Grant
07-04-2006, 12:32 AM
Hi Guys,

Working through Nehe's tutorial on outline fonts at: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=14

I notice he talks about font size based on character height vs cell. Can someone please explain this to me?

I ask because I tried changing his value for font size from -24 to -12 - but it didnt seem to make a difference??

-Al

zeoverlord
07-04-2006, 01:10 PM
take a look at this msdn page (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_8fp0.asp) about createfont.
I don't know exactly what it truly means, so i use glScale to get a bigger font, works just fine.

Hopefuly we(the NeheDev team) will find a better (and system independent) way of doing this when we rewrite the text tutorials.

Al Grant
07-04-2006, 03:20 PM
Weird, because i have tried changing the font size, to both positive and negative values to try and get a smaller font - and nothing changes!!!

Any ideaS?

zeoverlord
07-04-2006, 04:03 PM
It could be that wglUseFontOutlines does not use that value at all

i use this before glCallLists
glScalef(sx,-sy,1);
glTranslatef((x/sx),-(y/sy),0.0f);
instead of
glTranslatef(-length/2,0.0f,0.0f);

sx and sy controls the size
x and y moves it around the screen

Al Grant
07-05-2006, 12:32 AM
That worked - thanks. Would love to know why it doesnt work with the font size value?

-Al

Relic
07-05-2006, 02:02 AM
Read the wglUseFontOutlines manual. ;)
"The em square size of the font, the notional grid size of the original font outline from which the font is fitted, is mapped to 1.0 in the x- and y-coordinates in the display lists."

Means the fontsize you used to create the logical font is ignored and any glyph's OpenGL coordinates after wglUseFontOutlines are always in the range [0.0, 1.0].