Archived

This topic is now archived and is closed to further replies.

DrunkenHyena

New FastFont library

Recommended Posts

G''day! In my never-ending quest to make the world a better, happier place, I threw together a little library to do some text rendering. It uses the bitmap file created by Bitmap Font Builder (written by LMNOpc). Filling up half a screen worth of text, it was still running at over 400FPS, so it''s safe to assume it will have minimal impact when included in a project. Here it is. Let me know what you think. Stay Casual, Ken Drunken Hyena

Share this post


Link to post
Share on other sites
Thank you for sharing this.

I''m not sure I understand how/if this is better than the CD3DFont class included with the SDK. It seems more complicated to use because the fonts need to be included as extra media vs. being created at runtime (which seems to be very quick anyway)

Share this post


Link to post
Share on other sites
G'day!

I haven't (yet) compared the speed of ID3DXFont and CD3DFont, but I know my library is fast. There are pros and cons for the dynamic font vs static bitmap. The benefits I see are:
1)You can play with the bitmap to get some nice effects. Bevel it, shadow it, whatever.
2)Easier to use (code-wise). A lot of those font settings are WEIRD! The code to set up my library is very simple.
3)I like external resources. I can easily change my font by swapping the bitmap without a re-compile.

A lot of this is personal preference. I certainly don't expect everyone to stop using the other options, but I think it's always nice to have a few (IMHO decent) options to choose from.

I'll have to get off my butt and benchmark those other 2 methods (D3DX & CD3D) and see how they stack up. I'm pretty confident that it's faster than ID3DX, but I don't know about CD3D.

(edit)One additional note:The inspiration for this little library was to have a method of displaying FPS and other debug info while having minimal impact on what's running. Who wants an FPS counter that changes the FPS? It'd be like using a heated (or chilled I guess) thermometer.

Stay Casual,

Ken
Drunken Hyena

Edited by - DrunkenHyena on October 17, 2001 2:28:12 AM

Share this post


Link to post
Share on other sites
G''day!

I benchmarked CD3DFont, ID3DXFont, and dhFastFont (mine). The results and a couple notes are available on the dhFastFont page:
http://www.drunkenhyena.com/docs/dhFastFont.phtml

All things considered I think ID3DXFont is the most complex of the 3 to use, and most of that''s in the initialization. Of course it''s also the most featured of the 3.

In terms of speed and features, CD3DFont & dhFastFont are about the same. dhFastFont is a bit faster, CD3DFont has a few more features. I think the deciding factor will be the choice between whether you prefer to use a font texture or not.



Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites