Docs

CLI options

Reference for the @uno.build/fonts command-line options.

OptionValuesDescription
-fontPath to a .ttf or .otf fileInput font; also accepted as the first positional argument. Required unless using -varfont.
-imageoutOutput image pathAtlas image destination. Default: last input font path with its extension replaced by .png.
-jsonOutput .json pathExports metrics, Unicode glyph layout, and kerning. Default: last input font path with its extension replaced by .json.
-charsCode points, ranges, or quoted strings, e.g. '[0x20, 0x7e], "áéíóúñ"'Characters to include. Default: printable ASCII (U+0020–U+007E).
-charsetText file pathReads Unicode character selection from a UTF-8 or ASCII file instead of inline -chars.
-typemtsdfx, mtsdf, msdf, sdfAtlas type. Default: mtsdfx, with separate RGB and alpha distance ranges.
-sizePositive numberGlyph size in pixels per em. Default: 64, unless -minsize is supplied.
-pxrangePositive numberTotal symmetric distance range in pixels; RGB range for mtsdfx. Default: 16 (−8 to +8).
-effectpxrangePositive number ≥ -pxrangeAlpha/effect range in pixels, only for mtsdfx. Default: max(size / 2, pxrange) (32 with CLI defaults).
-yoriginbottom, topOutput Y-axis direction: upward (bottom, default) or downward (top).
-formatpng, binfloatImage encoding: 8-bit PNG or raw little-endian 32-bit floats. A .png path selects PNG; mtsdfx only supports PNG.
-allglyphsNo valuePacks every glyph, including unmapped glyphs; JSON omits glyphs without Unicode mappings.
-varfont"font.ttf?wdth=75&wght=700"Input variable font with axis values. Quote the entire argument.
-minsizePositive numberMinimum pixels per em; uses the largest size that fits the same atlas dimensions.
-glyphsGlyph indices or ranges, e.g. '0, 1, [10, 20]'Selects font-specific glyph indices instead of Unicode characters.
-glyphsetText file pathReads glyph indices and ranges from a file instead of inline -glyphs.
-csvOutput .csv pathExports glyph identifiers, advances, and bounds as an additional layout file.
-fontnameNameSets the font name in output metadata.
-andNo valueStarts another font input group in the same atlas; character selection carries forward.
-printvaraxesNo valueLists the input font's variation axes without creating default outputs.
-threadsInteger ≥ 0Accepted for compatibility; this WASM build always runs sequentially.

For more details, see the official msdf-atlas-gen repository.

See MTSDFX for details on the default atlas type and its distance ranges.