Downloads

Free Downloads


DirectFont v 1.2

A while back I was involved in a discussion on Lucky's VB Gaming Message Board about how bad it is to use the DirectDraw.DrawText method. Instead Lucky showed us how to use the GDI to implement fonts and the like. After looking over the tutorial, it sounded kinda confusing (with all those different pen types, and brush sizes and font pointers (okay, I made that last one up...)). I then asked a question about how efficient just Blitting the characters to the screen would be. It turns out that it was not bad, but kinda complex...so I decided to make a tool to do this. Anyways, to my point...

I've been working on something called DirectFont (barring any copyright bombardments by Microsoft ;)). It comes in two components. The first is an executable that you use to specify the BMP file (your character set) and the different definitions for each character. All you do, is basically press a key that you want to define, and then position the rectangle over the section of the BMP where you want that character taken from. One advantage of this over GDI, is that you can use fonts designed by other artists (like web fonts), instead of being stuck to just True Type fonts. One disadvantage, is that you can't really change the color or scale the fonts correctly using BMPs like you could with TT. To account for this somewhat, I've added a zoom function in version 1.2 of the project, which allows you to scale each character to between 0.5x and 2x the original size.

The second part is an ActiveX DLL that exposes a DirectFont object (so you'll just have to add a 'Dim moDirectFont as New DirectFont'). You can then just add a reference to your project, and you're set. It loads the font definition saved by the first component, and uses that to blit to the a DirectDraw7 surface you provide upon initializing the DirectFont object. All you'll have to do is say 'DirectFont.DrawText x, y, "Some string"' and it will draw it on the screen. There is also a setting for transparency. Check out my tutorials page for more information on how to use this...

P.S. - This is the final version of DirectFont as far as I'm concerned. I won't be adding any more enhancements or features in the foreseeable future. However, if you find a bug or something is wrong, let me know and I will fix it and release a patch.

Download Here - 1.41 MB

Back To Top