Skip to main content
gamedev.net
🔒 Locked

Font Engine..how to?

Started by gameover Apr 10, 2002 at 2:33 PM 9 replies 1.1k views
Original Post
gameover
gameover
Sup every1. I''m trying to make a simple mario-clone game. I''m using the engine that came with the Tricks Of the Windows Game Programming book(with some modfication). I want to implement some text info(at the very least, the current score accumulated) shown on screen. La Mothe says using the Windows GDI for it would slow things down. Anyone can help me out how to start my very own font or at least point me to the proper direction?. Thanks.
cearny
cearny
A good learning experience (I know, I did that) is to implement your own font exporter. Just take a look at http://www.freetype.org.


[ Libraries - STLport | boost | SDL | wxWindows ]

[ Manuals - MSDN | STL Docs ]

[ Compilers - VS.NET | MingW | DJGPP ]

[ Editors/Tools - EditPlus 2 | Anjuta | Dev-C++ ]





Taulin
Taulin
Because I deal with Japanese software, making a bmp with all the characters is impracticle. The freetype stuff looks interesting.

Did you implement it through DX? Does it look better than the GDI calls? Was there any problems copying the character bmp''s to a DXSurface?

Thanks!
gameover
gameover
Nope not dx..it''s a windows call that shows text onscreen. It uses TextOut for it. The problem with it is it slows down my game during da first minute ( my character moves noticeably slow a bit for a few sec then it goes back to normal...or maybe it''s coming from somewhere else...)

Thanks for da replay guys. I''m going to implement it using that "each-letter-is-a-bitmap" routine. Just as long as the scores are readable, it''s all good. THanks
Rufeooo
Rufeooo
Gameover,
I personally like the windows GDI functions. They''re quite powerful and I have not noticed a performance difference (yet) on my P2 450. It would take a lot of work to wrap all of the functionality windows has in their GDI functions.

Checkout the DrawText() function in addition to TextOut()
~Rufe
Ironside
Ironside
if you look over the dx8.1 sdk samples there is a font class taht can take any windows GDI font and render it to a texture and then draw it as textured quads. All you have to do is call a simple DrawText() method.
Big Sassy
Big Sassy
Honestly, I made a font class that loads in a bitmap with text and blits each letter, but I didn''t get much of a gain in my framerates. Plus I didn''t have anywhere near the functionality that GDI font functions have. IMHO go ahead and make a bitmap font class for the learning experience and then use GDI functions in your actual game.
Justus
Justus
The only problem with GDI is that you have no much freedom in creating beautiful and expressive fonts or adding some static effects as you can do by telling your game artist to make _really_ good font for you.
So, use GDI for testing purposes, and bitmap fonts for real game. But not vice versa
stevenmarky
stevenmarky
I recently made a graphic font system, the tricky bit was getting the kerning (is this the right word?, each character was a different width) right.
I made it so I had more control over the fonts, and could have them looking exactly like I wanted, also it was a pretty fast function, you can see pictures of it here: www.markyrose.freeserve.co.uk (scroll down a bit on the main page) : I will be using it in the game Im working on.

[edited by - stevenmarky on April 12, 2002 5:57:22 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.