Tool to preview all available fonts (even in-game at runtime)

There are some great tools for making or converting fonts, but I couldn't find any way to preview every font already provided by Panic. So I made one!

The linked .pdx lets you see lorem ipsum for all 54 fonts provided by Panic, with up, down, and crank cycling through the fonts.

BUT WAIT, THERE'S MORE!

If you add the "testfont.lua" file and dependencies into a game's build directory, you can dynamically change fonts at build or runtime, to see how all 54 fonts would look in your game!

Just use testFont() in place of the playdate.graphics.font object, .i.e.:

playdate.graphics.setFont(testFont())

Depending on the value of testFont.current_font_number (1-54), the corresponding font will be inserted. If you change testFont.current_font_number at runtime, then the font will be updated the next time you run setFont().

But what use is knowing the "number" of the font? Use testFont.getName() to

  1. return the file path of font (within the Resources/ folder of the Playdate SDK)
  2. print both the font path and the font "number".

Hope people find this useful!

4 Likes

This seems really great and useful for previewing fonts. Thanks for making and sharing it.

One issue though: the GitHub page is currently 404-ing. Is the repo set to private still?

1 Like

Yup! It was. Just fixed it. Great job both identifying and successfully troubleshooting a problem with zero information.

This is my first published repo, so if you notice anything else amiss, please let me know!

1 Like

I got it running locally really easily!

This is awesome. Thanks so much for making and sharing this @CoronaVitae. It's really helpful to see all the different fonts previewed on-device. Before this, I was just looking at the PNG tables trying to intuit how they look. :rofl:

1 Like