Proper use of egg-mkfont

Greetings all!

I have a section in the game we’re writing which calls for some dynamically-generated numbers mapped to an object in the scene (i.e. there’s a digital timer on a wall counting down numbers). This seems like the sort of thing for which egg-mkfont was created; if my guess is right. I used egg-mkfont to pull out the numbers 0 to 9 and the letter F from the Arial Black font with the following command line:

egg-mkfont -chars [0-9F] -o timer.egg ARIBLK.TTF

The program created an egg file and a .rgb font file. So far so good!

The problem is that I’m not sure how the egg file is intended to be used. I’ve dug through it a bit, but I’m not entirely sure what I’m looking at in terms of the groups in the file. Is the idea to load the egg file and lookup the different <filenameASCII_CODE> group names, then use them as the geometry for the digital readout?

Thank you for your help!

You can load the egg file in your game via loader.loadFont(), and then apply it to any Panda gui element you like. See Text Fonts in the manual.

Note that you don’t actually have to use the egg-mkfont utility; you can also load ARIBLK.TTF directly as a font file if you prefer.