pxart help fonts
Pixel fonts
A pixel font from text: one frame per glyph, an @font section for its metrics, kerning in pixels, exported to WOFF2, WOFF or TTF.
FONTS (pxart help fonts)
export FONT.px[:SEL] --font F.woff2|F.woff|F.ttf [--kern K.kern]
A pixel font from one file: each frame is a glyph, the frame's width its advance (the
blank columns on its right space it from the next), and every pixel that isn't
transparent is ink. Each glyph's ink is traced into its union outline (closed loops
around the pixels, no seams), crisp at any size that makes 1 px whole screen pixels
(an em of 10 rows: 10px, 20px...). Every glyph is the same height; a .notdef (a
hollow box) comes first. The same source writes the same bytes.
A frame's id is its glyph's name, and the name says the character: a name from
Adobe's glyph list (A, a, zero, period, comma, quoteright, eacute, space), uniXXXX or
uXXXXX (uni00A0, u1F600), or any name an @font 'map' line gives code points. A frame
with no character, of another height, or claiming a character another frame has is
E_GLYPH; FILE:SEL exports only the glyph frames.
An @font section sets the font's metrics, a line each, all optional:
@font
family Tiny Sans the family name (default: the file's stem)
weight 600 the weight (400); style: its name (from weight: SemiBold)
baseline 8 rows above the baseline (the frames' height: none below)
unit 100 font units per pixel (100); upm: the em (unit x height)
ascent 9 the line box above the baseline, in px (baseline)
descent 3 and below it (the rows under the baseline)
cap 7 cap height in px (H's ink); xheight: x's
map bullet U+2022 a name's code points (one or more)
and version (1.000), vendor (4 letters), license, psname (family-style, no spaces).
Kerning: lines 'LEFTS RIGHTS PX' in an @kern section, or in --kern K.kern ('#' starts
a comment line; its lines come after the section's, and a later line wins a pair):
every character in LEFTS followed by every one in RIGHTS moves PX pixels (negative:
closer). 'T aceo.,: -2' tucks them under T's bar. A pair that would make its glyphs
touch, even at a corner, is E_KERN.
In the .px, a run can't start with '#' or '@' (a comment, a section).
Put @font and @kern after the palette, between frames or at the end (edits write them
last); check --strict takes them. Errors are said all at once, at file:line, and
nothing is written: E_FONT (an @font line), E_GLYPH, E_KERN.
Needs fontTools, and brotli for .woff2: pip install fonttools brotli.This page is built from
pxart.py in the repository.Edit on GitHub