Font Fun

Adam C. Clifton
1 Feb 2016

With our efforts to pretty up Flashcard Fight in order to release a demo, some problems have cropped up with our fonts. Mainly that the fonts Kristy has selected for use in the updated UI don't actually support Japanese.

Initially I was looking at solving this by loading the old and new fonts at the same time, and falling back to the old one whenever a missing character needed to be drawn. This was making the font system a little more convoluted, and it also didn't solve another font problem, that we are loading a 4mb ttf file and only using about 80 characters from it. Since Flashcard Fight will also have a web version that needs to download all assets every time you play, it was important that I slim that down before release.

So I went back to the drawing board and have created a script, with the help of FontForge, that finds all the kana and kanji used by the game, and inserts them into the new font. After running the script, the total size of our fonts is down to about 230 kb. Also, during my investigations of the ttf format, I noticed that it isn't actually compressed so that's another optimisation to be added that should halve the size again. I'm not sure if i'll do that upfront or if I should wait until I develop some sort of packed file structure containing all the game assets that I can just compress once.

Previous: Sayonara
Next: Screenshot Saturday 2016-02-06
© Numbat Logic Pty Ltd 2014 - 2017
Privacy Policy