OpenGL Fonts Tip

Started by
2 comments, last by dpadam450 7 years, 11 months ago

I went back into my old font code which is from the old NEHE tutorial years ago. I finally had the need to support multiple fonts because I actually want to release a game. I'm using wglUseFontBitmaps and CreateFont.

Anyway maybe someone will stumble upon this and help them down the road but it took me a while to figure. The tutorial was using ANSI_CHARSET instead of DEFAULT_CHARSET, so 99% of the fonts I used seemed to not work at all. For instance webdings wasn't showing symbols but was printing like a normal font.


font = CreateFont(  -1*fontSize,
                        0,
                        0,
                        0,
                        FW_DONTCARE,
                        FALSE,
                        FALSE,
                        FALSE,
                        DEFAULT_CHARSET,
                        OUT_TT_PRECIS,
                        CLIP_DEFAULT_PRECIS,
                        ANTIALIASED_QUALITY,
                        FF_DONTCARE|DEFAULT_PITCH,
                        fontName);

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Advertisement

I would say don't use NeHe tutorials for anything anymore. They're so outdated.

I use FreeType 2, there are plenty of tutorials for it too.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

I'd recommend using BMFont. It's easy to set up.

Aether3D Game Engine: https://github.com/bioglaze/aether3d

Blog: http://twiren.kapsi.fi/blog.html

Control

I would say don't use NeHe tutorials for anything anymore. They're so outdated.

I'm outdated. I'm on GL 2 still.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement