D-side / ftl_font

Font dissection tools for FTL Faster Than Light version 1.6
MIT License
10 stars 0 forks source link

FTL 1.6 Font manipulation tools

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.

Usage

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.

Setting up the toolset

  1. Install Ruby 2.4. Use RubyInstaller Archives (search for Ruby 2.4.10-1 (x64), it's the one you probably want, DevKit is not necessary for this tool)
  2. Download & unpack or git clone this repository
    • See Code > Download ZIP above if you're not sure what this means; then unpack the resulting file somewhere
  3. Use Slipstream Mod Manager to unpack FTL's resource file, ftl.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"
  4. Install the version of Bundler used during creation (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!

Using the toolset

Patching

Just so you know what's what, the build process goes like this:

So to alter a font you'll need to create:

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.

Dismantling

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.

Limitations

Contributing

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.

Why not a gem?

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.