Skip to content

PixelFontFile

Extends FontVariation. Read from the plugin's source on every build.

A font that is a font document, kept in step with it.

Anything that takes a Font — a Label, a Button, a RichTextLabel, a Theme’s default font — can point at one and follows the glyphs as they are drawn. For a game that ships without the addon, Export with Font writes a plain FontFile.

A bitmap font of one size, the cell’s height. A whole multiple of that size draws the glyphs that many times over, pixel for pixel, and any other size draws at the largest multiple under it: an 8 pixel font at 24 is three times, at 20 twice.

A scene holding one stores document alone, and loading it builds the glyphs from the document.

Properties

document

@export var document: PixelFontDocument

The font document this is, rebuilt as the document changes.

Methods

font_file

func font_file() -> FontFile

The FontFile this varies, filled from document: the glyph table a test or a tool reads. Not for keeping: the next rebuild refills it.

rebuild

func rebuild() -> void

Fills the font from the document. Public because a caller that has changed a document behind the signals can ask for it.

Signals

document_changed

signal document_changed

The glyph table landed: after rebuild, or after the rebuild a change to the document queued, whatever changed it: a stroke, a save pushed to the running game, or the file changing on disk.

JamChip, by GlitterSnack. MIT licence. Built from the source on every merge. Its artwork and screenshots are made with JamChip.