Tools for web, multimedia and game developers. FontGrabber is a great tool for exporting fancy fonts and text images for use in multimedia projects, web sites and indie games.
 
 Using DarkBASIC Pro
 
Home FontGrabber     Sample Images     Sample Exports     Screenshots     Rollover Help     DarkBASIC Help     Indie Games     Dev.Community     Pro Version     Licensing & Trial     Buy Now Downloads Contact Us
FontGrabber - Using DarkBASIC Professional

Using FontGrabber fonts in your DarkBASIC Professional game is really easy. The following is an example program we put together to demonstrate this:

Example Screenshot

DarkBASIC Example Screenshot

Doing it yourself

To use FontGrabber text in your own DarkBASIC applications, you need to do the following:

  • Create the font in FontGrabber and save it to the folder where your DarkBASIC game files are. You'll probably save it in the same folder as your .dba files.
  • Run the ConvertToDBpro utility (Available from our Downloads page). You will be shown a file selection dialog. Select the .fgrab file that you saved in the previous step. The utility will create a new file with the same name, but a .fgdbpro extension. By the way, the original .fgrab file is not required for your DarkBASIC program, but keep it just in case as you may want to change the font later in FontGrabber.
  • Now include our example dba file which contains some basic methods to load and display fonts.
  • Lastly, add the necessary code to load and render the text.
Example Program

If you want to see the above example in action, please download the zipped executable here.

The above download also contains the ConvertToDBpro utility, the sample exported fonts (Not the actual true-type fonts we used) and our include file that contains the basic functions to load and render text. You can also open the code from our example to see exactly how we did it.

Note: The ConvertToDBpro utility requires the .net framework 2 on your system. If you don't have it, you can get it directly from Microsoft.com or just download and install FontGrabber which will automatically install the correct files for you. Also note that the framework is only required by our software. You will not need it to use FontGrabber fonts in your DarkBASIC Pro games.

Just to show you how easy it is, here's a basic example of the code needed to render a line of text:

#include "FontGrabber.dba"
Font1=LoadFont(1,"font1")
DrawString(Font1,"This is a FontGrabber font...",0,0)

Our include file also contains one other useful function to render your score:

DrawScore(Font1,myscore,0,0,5)

The above command draws your score at position 0,0 using 5 digits.