Skip to main content

Module meta

Module meta 

Source
Expand description

Serialization types for the raster font asset format.

§Example TOML

A raster font asset is a TOML file (and accompanying image) with the following top-level shape:

layout = "abc$(->|=>)xyz"       # OrdTokenLayout string
image  = "font.png"             # relative path to the font texture

[pack]                          # PackingMode — uniform grid or dynamic tracks
size   = [8, 8]
region = { min = [0, 0], max = [8, 8] }

[override."a"]                  # Optional per-glyph overrides (region, offset)
region = [[0, 0], [6, 8]]

[extract."$(:\))"]              # Manually extracted glyphs (ligatures, icons, etc.)
# ref    = "a"                  # Extract relative to the region of "a" in the atlas
region = [[128, 0], [136, 8]]

Most users will not need to interact with this module directly. See the token module and the layout module for token and sequence syntax.

See PackingMode for details on uniform vs. dynamic atlas layouts, and CustomGlyph for how to manually extract glyph regions.

Structs§

FontLayout
A raster font layout, defining the mapping of characters to glyphs and their properties.
FontMeta
An image-based font format designed for pixel art games, supporting dynamic glyph packing, manual region extraction, glyph nudging, and ligatures through a flexible token system.
FontTrack
A font track serves as a moving template when constructing a RawFont.
GlyphOverride
Overrides for specific sequences, allowing for custom regions and baselines on a per-glyph basis.

Enums§

CustomGlyph
A manually extracted glyph that doesn’t fit the regular packing mode.
PackingMode
Determines how the atlas builder’s view moves after analyzing a token’s glyph region.