No description
Find a file
2025-10-16 21:18:52 +02:00
example example with box drawing chars 2025-07-31 01:30:05 +02:00
src more output on inspect; optionally print all symbols 2025-08-05 20:07:16 +02:00
.gitignore make splitting functionality dynamic with json-ized data structure 2025-07-31 00:59:35 +02:00
Cargo.lock clap with commands: inspect, split, create, split-and-create 2025-08-05 01:49:57 +02:00
Cargo.toml clap with commands: inspect, split, create, split-and-create 2025-08-05 01:49:57 +02:00
README.md added a little more to the readme 2025-10-16 21:18:52 +02:00

Font Helper for Karlos

Features

  • take images containing several chars and break them down into individual images (splitting)
    • images containing several consecutive characters in 2D arrangement
    • images containing several arbitrary characters in 1D arrangement
    • images containing a single character
  • build a font automatically out of these individual images
    • sequential chars are automatically grouped

Example

cargo run -- split-and-create --index example/index.json --font-dir font --encoding BitPerPix4 font.sff

Command Line Arguments

A font is specified by its glyph width, glyph height, and one or more splitters (see below).

Commands are (use <command> --help to get more information):

  • Inspect (inspect): inspect a font, printing attributes and symbols.
  • Create (create): from a set of images containing single glyphs, create an sff font file.
    • the file name of the glyph images should be its number in base 10, so the glyph for a is 97.png
  • Split (split): parse a sequence of splitters and create individual images.
  • SplitAndCreate (split-and-create): apply the above two commands in sequence.

Splitter

For an example of how to specify these splitters, refer to example/index.json.

The following variants exist:

  • Table: a rectangular grid of glyphs, numbered ascending left to right and top to bottom.
    • path: String: file path to image
    • nrows: Int: number of rows
    • ncols: Int: number of columns
    • start_number: Int: first glyph number
  • Individual: one row of glyphs, each with an individual (non-consecutive) number.
    • path: String: file path to image
    • numbers: [Int]: list of glyph numbers
  • Single: a single glyph.
    • path: String: file path to image
    • number: Int: the glyph number