View Full Version : problem changing fonts

11-29-2010, 08:31 PM
I'm having a bit of trouble setting up the font for the text in my app.

It renders the text just fine, but it only seems to display in a default font. The changes I make in CreateFont don't seem to be reflected inside the app.

Here are the excerpts I use to create and render the font.

I stepped through the font creation and it seems to be executing fine, but I can comment out the CreateFont and SelectObject lines and it will still render as seen in the below linked screen capture. Any help would be greatly appreciated.

Here is a Screenshot (http://yfrog.com/f/0hfreeworld20101129222246j/) of how it displays currently.

void Interface::SetupFont(HDC &g_HDC)
*basefont = glGenLists(256);
*hfont = CreateFont(24,0,0,0,FW_BOLD,false, false, false, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, "Times New Roman");

if (*hfont)
SelectObject(g_HDC, hfont);
wglUseFontBitmaps(g_HDC, 32, 96, *basefont);

void Interface::WriteFPS()
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glTranslatef(0.0f, 0.0f, -1.0f);
glRasterPos2f(0.2, 0.486f);
glListBase(*basefont - 32);
glCallLists(strlen(realTime_->getStrFrameRate()), GL_UNSIGNED_BYTE, realTime_->getStrFrameRate());


For reference in case it matters I'm using Dev. Studio 2005 and Vista 64 bit.

11-30-2010, 09:13 PM
Any ideas at all would be appreciated. Or if you need more info to figure it out let me know and I will get you the info.