Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Importing custom fonts from file?

A topic by JHSoftware created Nov 02, 2022 Views: 350 Replies: 6
Viewing posts 1 to 4
(+1)

Hey everyone,

Been trying to figure out how to import custom fonts into Decker from a .ttf or similar, I’ve looked through the documentation and, although font interfaces are mentioned, it’s still not clear to me how to import custom fonts, if at all.

Anybody know how to help me out?

Thanks!

Developer (1 edit) (+3)

Decker uses a custom bitmap font format. It provides the basic building blocks for creating and editing new fonts, and the examples directory includes a very basic font editor tool, along with some additional fonts: https://github.com/JohnEarnest/Decker/blob/main/examples/decks/fontedit.deck

If an existing deck contains non-default fonts, you can import them into your own decks using the Font/DA Mover (File -> Resources...) I hope that, in time, Decker users will make and share a wider variety of fonts.

There isn't currently any way to directly convert from a .ttf into a Decker font, but if someone else wants to have a go at writing a conversion utility it could be very useful for other Decker enthusiasts!

If you already have a monospaced font in a GIF bitmap, it isn't too hard to use Lilt to do the conversion; I prepared a few fonts like this (which has a lot of unused glyphs and needed a custom-drawn ellipsis glyph):


Using a script like this:


Which produces an otherwise empty deck containing the newly created font.

(+1)

Ah! Gotcha! I’d already transported custom fonts from the example decks, I just wanted a few more to use - I’ll take a closer look at your script and do some experimentation in converting fonts and see what mileage I can get.


Thanks!

Developer(+2)

My friend ktye has taken the time to convert several more monospaced bitmap fonts: https://github.com/ktye/i/blob/master/_/i2/kui/f/fonts.deck

Ah! Thank you very much!

(2 edits) (+2)

Here is another deck which adds a bunch of custom fonts to the fontedit deck.

https://github.com/1jss/decker-fonts

Thank you!