Giter VIP home page Giter VIP logo

Comments (4)

D-side avatar D-side commented on June 30, 2024

I haven't found any tools that make working with TTF or OTF programmatically easy enough. I would've went for one of those as an intermediate output format otherwise, because there are a few mature graphical editors out there for modders to use.
But, alas, I didn't find anything.

I found that most of the time people need bitmap fonts out of "regular" fonts, and not the other way around as we would want.
The only thing I've found during my brief search is that FontForge may be able to import the glyphs provided they are properly named. Which is not hard to arrange.

You can modify the code that does the disassembly to adjust the way it exports PNGs. This is the line that defines the filename of individual disassembled glyphs:

filename = "#{c.character}.png"

#{c.character} is Ruby syntax for replacing this part of the string with the textual value of c.character, which in this case is a decimal equivalent of UTF-8's 4-byte code point. It's not the same as Unicode code point though, so this is what I think would satisfy FontForge:

    filename = "uni#{c.utf8_character.codepoints.first}.png"

Not sure about the leading zeros though, I can see them in the docs, but I'm not sure if there is any significance behind them.

Also, glyphs don't store baselines and spacing. Not sure if anything can be done about them other than typing in manually following the exported index JSON, which for hundreds of characters would most certainly be a major pain.

Also you might want to ask the nice people at Subset Games about whether they would allow the use of their FTL assets for something other than FTL mods 🙂

from ftl_font.

gradientogames avatar gradientogames commented on June 30, 2024

I have a similar issue, for another project I would like to extract all the fonts for a project, I can make ttf files but a json file and a png with all characters of the .font file in one sheet.

I know I might be being stupid but this project doesnt have a detailed enough tutorial or documentation, but is there a way to do this?

from ftl_font.

D-side avatar D-side commented on June 30, 2024

@gradientogames because of how rare uses of this tool are, I did not bother with more generic documentation, yes. It was originally built to support localization and related modding efforts around FTL, all that targeted the game itself, so there are no facilities for the processes that in the generate something other than FTL font files.

So if you have something else in mind for the font data, then it calls for a new Ruby script alongside dismantle/reassemble that'll do what you need. I'll be happy to help, it shouldn't be a lot of work, but I'll need to know the intended shape of the data in more specific terms 🙂

If you'd rather avoid learning Ruby and want to do this yourself, the key bit of information in this project is the binary structure of the file expressed reasonably declaratively in these files: file section (header with a list of characters) and tex section.

from ftl_font.

gradientogames avatar gradientogames commented on June 30, 2024

@D-side
if you can, that would be great! Im allready learning c# for unity, python, javascript and I don't want another language on top of that so if you can, amazing! But if not, I could just manually rip the font from the game (I allready did with the title font, why not the others).

from ftl_font.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.