This is a toolset for adding and replacing characters in fonts from FTL: Faster Than Light version 1.6.
The initial intended goal for this project is to add cyrillic symbols to these fonts, but if you find other uses for these tools, go ahead!
Also, source code doubles as documentation for the format, since it uses bit-struct
that allows for pretty readable descriptions of binary structures. See lib/ftl_font/binary/*.rb
for details and lib/ftl_font/binary_wrapper.rb
to see how they come together. Or file an issue for me to document the format in a more human-digestible way.
This toolset is intended for use primarily on Windows machines, thus the step-by-step guides will assume Windows.
It will work on Linux and OS X as well with no changes, but the guides might not reflect the exact steps you might need to do there. If there's any demand for instructions for Linux, I'll be happy to add them in! OS X is too much of a hassle for me to test on, sorry, but steps should be almost the same.
Ruby 2.4.10-1 (x64)
, it's the one you probably want, DevKit is not necessary for this tool)git clone
this repository
Download ZIP
above if you're not sure what this means; then unpack the resulting file somewhereftl.dat
, located inside the game folder. You'll see a folder called fonts
in there: copy it into the downloaded repository, you should be prompted if folders should be merged, click "yes"gem install bundler -v 1.1.6.1
) and use it to install dependencies (bundle install
).
setup-ruby.bat
for Windows does just that in a double-click, run it, wait until it finishes and you're set!Just so you know what's what, the build process goes like this:
font_templates
folder for any *.json
files; for each <name>.json
file found:
source
optionadditions
option (an "addition" is a folder of characters to add or replace)assembled
folder under the name of <name>.font
(after the *.json
file from font_templates
)So to alter a font you'll need to create:
additions
folder: there are a few examples there, but in general every set comprises of:
index.json
with a JSON array of parameters; one set for every character to add or replace.FontNameHere.json
file in font_templates
with the instructions.
fonts
folder) and adjust the list of additions (folder names inside the additions
folder).If you've done that, or you want to build an example font, execute the reassemble.rb
script. Once it finishes, you should have the corresponding patched *.font
files in the assembled
folder.
Note: in case such a font already exists there, it silently overwrites it! This is just to make adjustments quicker.
Useful if you want original characters from a font with the intent to edit them or just change their parameters.
The process is easy: run dismantle.rb
and wait until it completes. You should then have a bunch of *.original
folders inside the additions
folder, ready to modify as you see fit. Yes, they are ready-to-use additions too.
` (space) have **zero width** in the original fonts and thus cannot be exported as PNGs (ChunkyPNG, that I'm using, can do it, but it will choke when trying to open the result). Such characters are not currently supported in additions. Zero width can be emulated by using a 1-pixel wide black "character" with one of the spacings (
beforeor
after`) set 1 pixel smaller (negatives are valid in spacings too!). You can also let me know you need proper support for these by filing an issue.0x00
for fully transparent and 0xFF
for fully opaque. It makes sense to only use white, black and grays. Others won't cause crashes, but will be converted to grays anyway with an algorithm I don't know (or want to know, really).I'm estimating the number of potential contributors to this project as 1 (one), that's including myself. So I may have skipped some steps that could facilitate contributions for others.
I do appreciate any help with this though! If you wish to contribute, but something about this repository is stopping you from doing so, file an issue, we'll figure it out.
Packaging it up as a gem with a few executables that perform transformations of fonts looks highly appealing! But requires some work I just haven't done yet.