It is currently Tue Aug 22, 2017 1:34 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 1 post ] 
Author Message
 Post subject: Font TGA files with GIMP
PostPosted: Wed Aug 11, 2010 12:00 pm 

Joined: Wed Dec 24, 2008 4:25 pm
Posts: 16
Being a pecuniary sort, I prefer using GIMP over PaintShop Pro or even Photoshop. But not being a highly proficient graphic artist, it took me a while to figure out the process for creating Fonts using FontImage and GIMP. Here is what I came up with (and would be open to any suggestions for improvement):

How to use Font Image and GIMP together.

1. Using Font Image, create the desired font, black on white.

2. PrntScrn to capture screen to clipboard.

3. In GIMP, select File->Create->From Clipboard

4. If proportional, in Font Image, File->Save text file. Copy "lastfont.txt" from Font Image folder into target resources/fonts folder as "<fontName>.tga.txt", where <fontName> is the same as the base filename in the eventual TGA file. Close Font Image. All further actions are in GIMP.

5. Use crop tool to crop appropriately-sized portin of client area.

6. Scale image to appropriate size, which must be square with sides n^2.

7. View->Show Grid, and set grid to size appropriate to image size:
512x512: 50
256x256: 25
128x128: 12
Inspect each character to assure it is fully within each grid cell, and use Rectangular Select tool as needed to move. (Ctl-Alt to move, double-click outside selection to finish each selection.) Remove grid if desired.

8. Add Alpha Channel Mask:
Layer->Mask->Add Layer Mask..., Grayscale copy of Layer(Invert Mask = true)

At this point, you have a black font with transparency everywhere.

9. Make foreground white:
Unlink mask and foreground; select Layer foreground (not including mask). Select All (verify marching ants surround entire texture). Select Bucket Fill, Fill Type = BG color fill; click in selection.

10. Save file
You will get a warning about TGA not saving visible layers. Confirm this warning, then Export the file. Accept the default RLE Compression and Origin, since Marek's loader knows how to handle these.

11. Colors:
If the font wants to have its colors controlled at runtime, make them white, and pass Color(r, g, b) to the PrintText function. If you want fonts with funky surfaces, make them what you want and pass Color(255, 255, 255) (white) to the PrintText function.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron