Font Editor

Pyxen includes a font editor for creating bitmap fonts on iPad and Mac that you can use with the Text component. Design crisp, pixel-perfect text for your games without any external tools.

How bitmap fonts work

A bitmap font in Pyxen is a font atlas — a single image containing every character, plus a JSON file describing where each glyph is located. When your game renders text, the engine looks up each character in the atlas and draws the corresponding region.

Creating a font

Choose File › New Asset… and pick Font. It is made from one of two:

The font opens in the Font pane.

The Font pane

At the top, Try it draws a line you type with the font, on your game’s background, at the sizes the game draws it (1×, 2× and 4×). Below it are the font’s glyphs; pick one to edit it.

The side column sets up the font:

Size, the characters and smooth edges change by making the font again, so they need its file. A font made from Pyxen’s Font, or from a font that isn’t on this device, shows them as words until you choose a file; its spacing and its glyphs stay editable.

Editing glyphs

The picked glyph opens on the canvas, in its line, with its baseline and advance drawn. Draw on it with the Pencil (B) and erase with the Eraser (E). Every change can be undone, and Try it shows it at once.

Using fonts in your game

Once you’ve created a font, use the Text component to render text:

label = world.spawn(text=Text("Score: 0", font="myfont"))

The font parameter matches the name of your .font.json asset (without the extension). If you omit it, Pyxen uses the built-in default font.

See the Text reference for the full API.

Used in Code in the pane’s bar lists the lines of your scripts that name this font; choose one to go to it.