Dérek Boily
Canada
Québec
Quebec
flag msg tools
badge
Avatar
mbmbmbmbmb
Hi,

Long story short; I'm thinkering with retheming* a simple card game (High Society, in this case) using art assets from a video game (Spelunky HD, in this case). This is mostly done to improve personnal skills, but also to enjoy a nice game with graphics I like.

I'd really like to use the custom font used in the video game for the game text on the cards. So far, I managed to determine that the game use something called a bitmap font, which is a font that the game can read. It is a combination of two files, first a ".fnt" file, which is basically a text file listing the characters of the font, and the second is a ".dds" file, or an image file containing all the image of characters.

Is there any way to use these two files to create a font with a "readable" extension...? Something windows would detect as a valid font file (.ttf or something). I'm no expert at all, but I'd listen to any suggestion; my google-fu skills have failed me to provide with any sort of solution.

Thank you very much!

*The retheme will be for personnal use only and I don't intend to distribute the final files.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
K H
United States
flag msg tools
Avatar
mbmbmbmbmb
I dug around the net and found no tools that would do it directly. What I found instead is enough information to know it will be a pain to do manually. You are starting out with a bitmap (raster) font. I think you already know what this means, but for those playing along at home I will explain.

In a raster format, the image is made up of a grid of uniformly sized and spaced rectangles called pixels. Each pixel is one solid color selected from a palette of available colors. The palette may be tiny (just the 2 colors black and white), huge (over 16 million colors to choose from), or somewhere in between. The important point here is that each pixel is defined independently of all other pixels. There are no lines, no shapes, just an array of colored tiles that the human brain blurs together into blobs to which it somehow assigns meaning.

If the output device resolution exactly matches the raster image resolution, it looks great. If the output resolution is an exact integer multiple of the image resolution, the picture looks like a staircase viewed through a magnifying lens -- a bit blocky around the edges but otherwise acceptable. If the output resolution is not an integer multiple, then the picture just looks awful.

What you want is the same typeface, but in a modern font format you can readily use. The catch is that all of the modern font formats are in a vector image format -- and for good reason. Again, you may already know this, but for the folks playing along at home I will explain.

Vector images do not store pixels. They store geometry: endpoints of lines, control points of Bezier curves, stroke widths, and so on. From these data, shapes are constructed from which pixels can be computed perfectly at any output resolution.

So how can you get vectors from pixels? Well, that is the tricky part. One way is to use the human brain to interpret the image and to manually trace the outlines using a program that captures the traced path as lines and curves in a vector format. This is slow and tedious, to put it mildly. Another way is to use smart filter algorithms to accomplish the same basic process automatically, and then clean up the output by hand when it inevitably makes mistakes. This is a lot faster (usually) but it relies on specialized, and possibly expensive, software. The third option is to declare that each input pixel is just its own tiny rectangle object in the vector output, and call it a day. Then you will have what is technically a vector format image, but without any of the usual benefits of a vector format image, and with all of the drawbacks of a raster format image. Sadly there is no such thing as a free lunch.

(more to follow)
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
K H
United States
flag msg tools
Avatar
mbmbmbmbmb
If you are willing to put in the work to convert the font manually, start by using a tool that will convert the .DDS file to a .BMP or .PNG file. There are websites that offer to do this for free. Search for "DDS to PNG convert". Then open Inkscape, load the PNG or BMP file as a layer object, and start a new layer where you will trace the edges of each glyph by hand. This part of the process will closely mimic this map-making tutorial. (Thanks to
Laura Creighton
Sweden
Göteborg
flag msg tools
Avatar
mbmbmbmbmb
for sharing that link earlier!) Then you will have a new problem, but maybe it will be an easier one to solve: convert an Inkscape .SVG file -- or perhaps a series of them -- into a vector font file format. Good luck.
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Andrew Cook
United States
Sheldon
IA
flag msg tools
badge
Avatar
mbmbmbmbmb
You can also try running it through a font finder to find a ttf equivalent, like http://www.whatfontis.com
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Pelle Nilsson
Sweden
Linköping
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
K H describes well what pain tracing a bitmap to vectors generally is, but Inkscape (and other apps) have a built-in tool to automate it, and on a typical font it probably makes a very good job. Photos are tricky because of all the colors and noise.

Also if the font is low resolution and supposed to look very blocky like an old video game (and I suspect that is the case here?), you do not want any very clever way to turn it into vectors, you just want to make straight lines along the pixels/rectangles, never try to guess what curves the shapes represents. This would make it possible to automatically turn into a TTF if there is a tool for that, and I would be surprised if there is not?

EDIT: And a quick google turns up this page that has links to some tools that supposedly can do the conversion semi-automatically: https://stackoverflow.com/questions/3750124/how-to-convert-a...
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Andreas Joska
Austria
Wien
Wien
flag msg tools
Avatar
As there was mentioned before, converting a raster image into a vector is hard to do and a load of work. The result will probably be quite hard to read and therefore useless.

I would recommend searching for a free font on https://www.1001fonts.com or https://www.dafont.com/de/

These sites provide loads of excellent choices of free fonts and you can filter them by categories. Hope this will be of some help to you.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Dérek Boily
Canada
Québec
Quebec
flag msg tools
badge
Avatar
mbmbmbmbmb
Thank you very much to everyone who answered! I more of less gave up on converting my font file, but at least I've learned a few interesting things along the way!
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls