Skip to main content

petiglyph is a TUI and CLI tool for turning images and videos into custom font glyphs

Project description

petiglyph

petiglyph is a TUI and CLI tool for turning images and videos into custom font glyphs.

Demo video

Quickstart

1. Installation

Choose one:

npm install -g petiglyph
pip install petiglyph
yay -S petiglyph

You can also download a prebuilt binary from GitHub Releases.

Make sure ffmpeg is available on PATH.

2. Usage

In a terminal, go in the folder where you want the project to be, and type:

petiglyph

This opens the TUI Home panel, where you can create a project and start importing media to create glyphs, grids, and animations.

Supported media:

  • images: png, jpg, jpeg, webp, bmp, gif, svg, avif
  • animation media: gif, mp4, mov, mkv, webm, avi, m4v

Generated glyphs can be of 4 types:

  • standard monospace, static
  • standard monospace, animated
  • grid of glyphs, static
  • grid of glyphs, animated

[!WARNING]
After installing petiglyph fonts, you need to reboot all instances of the terminal you're using, or, if it doesn't work, reboot your computer, to make sure the new fonts are correctly loaded by your apps or system.

For all 4 types, petiglyph will generate the static and animated glyphs in the Installed petiglyph fonts area of the Home panel after installing the fonts.

To copy those glyphs for reusing them elsewhere, you have to navigate with your arrows to the Installed petiglyph fonts area, select the glyphs that you want, press ENTER to copy them to your clipboard, and paste them in your own tools or apps (those apps need to also have the new fonts loaded, see warning above).

Pressing ENTER on the animated glyphs copies all frames inside the clipboard. To see them animated, you need to make your own script to render all the glyphs into an animation.


Documentation

CLI Workflows

Create an automation-oriented project:

petiglyph new-project my-font

Each project is self-contained:

my-font/
  petiglyph.toml
  images/
  build/

images/ holds source images and imported animation frames, build/ holds generated artifacts, and petiglyph.toml holds project config.

Bare petiglyph and petiglyph tui open the workspace TUI. Scripted project operations use an exact project directory basename:

petiglyph use-project my-font build
petiglyph use-project my-font install-font
petiglyph use-project my-font show-sample
petiglyph use-project my-font doctor --repair
petiglyph use-project my-font tui

Project discovery searches the current directory and descendants through depth 2 without following directory symlinks. Duplicate basenames are rejected with candidate paths.

Create Glyphs

The four creation types match the TUI:

# One image per glyph
petiglyph use-project my-font create glyph \
  --input logo.png mark.svg

# One sprite sheet split into glyph cells
petiglyph use-project my-font create grid-glyph \
  --input icons.png --rows 4 --cols 4

# GIF/video frames as glyphs
petiglyph use-project my-font create animated-glyph \
  --input spinner.gif --name spinner --fps 8

# Each GIF/video frame split as a grid
petiglyph use-project my-font create animated-grid-glyph \
  --input dashboard.mp4 --name dashboard --fps 10 \
  --rows 2 --cols 4

One --input accepts multiple paths. Creation imports and configures sources without installing by default.

  • --build also generates BDF, TTF, mapping, sample, and preview artifacts.
  • --install implies build, performs managed installation and cache refresh, and prints the sample.
  • --threshold defaults to 64.
  • --invert accepts on or off.
  • Brightness, contrast, and gamma options control grayscale preprocessing.
  • Static grayscale preprocessing defaults off; animated preprocessing defaults on.
  • Grid horizontal bleed defaults to weak; vertical bleed defaults to off.

Supported static inputs are png, jpg, jpeg, webp, bmp, gif, svg, and avif. AVIF is converted to project-local PNG. Animation media supports gif, mp4, mov, mkv, webm, avi, and m4v.

Configure Sources

petiglyph use-project my-font configure glyph logo.png \
  --threshold 88 --invert on

petiglyph use-project my-font configure glyph logo.png \
  --clear-threshold

petiglyph use-project my-font configure grid-glyph icons.png \
  --rows 2 --cols 8 \
  --horizontal-bleed strong --vertical-bleed off

petiglyph use-project my-font configure animation spinner \
  --fps 12 --threshold 72 --invert off

petiglyph use-project my-font delete animation spinner

Grid dimensions and bleed are rejected for non-grid animations. Clap rejects mutually exclusive threshold operations.

Build And Install

petiglyph use-project my-font build
petiglyph use-project my-font install-font
petiglyph use-project my-font show-sample

Installation is always explicit. show-sample only reads build/glyph-sample.txt; it does not build or install and reports the required build command when the artifact is absent.

List And Delete

petiglyph list projects
petiglyph list installed-fonts
petiglyph delete-project my-font another-project
petiglyph uninstall-font "my-font Petiglyph"
petiglyph uninstall-all-fonts
petiglyph doctor --repair

list installed-fonts prints the exact managed family identifier accepted by uninstall-font. Batch deletion and uninstall validate all targets before changing files.

Project listing includes directory name, relative path, font name, manifest path, project ID, and malformed-manifest warnings. Installed-font listing includes family, ownership, TTF path, manifest path, and stale metadata/artifact warnings.

JSON Automation

Add --json to automation commands:

petiglyph list projects --json
petiglyph use-project my-font create glyph --input logo.svg --build --json
petiglyph use-project my-font doctor --json

Output uses a stable envelope:

{
  "ok": true,
  "command": "use-project.create.glyph",
  "version": "0.1.1",
  "data": {},
  "error": null
}

Failures return a non-zero exit code and include error.message plus nested causes.

Runtime Notes

ffmpeg is checked before every command:

  • Pass --ffmpeg-auto-install to run the detected platform install command.
  • Set PETIGLYPH_NO_FFMPEG_PROMPT=1 to suppress the interactive hint.

The TUI requires a terminal. Its Home panel supports project selection, all four creation workflows, previewing, tuning, building, installing, and copying samples. On Windows, creation workflows use a native file picker.

Managed install roots:

  • Linux: ~/.local/share/fonts/petiglyph/
  • macOS: TTFs under ~/Library/Fonts/, metadata under ~/Library/Fonts/petiglyph/
  • Windows: %LOCALAPPDATA%/Microsoft/Windows/Fonts/petiglyph/

After installation, fully restart applications that need to reload font state.

Manifest Defaults

input_dir = "images"
out_dir = "build"
font_name = "Petiglyph"
glyph_size = 64
threshold = 64
codepoint_start = "U+100000"

project_id is managed automatically. Threshold and invert overrides use source keys relative to images/.

Development

Useful docs:

Useful environment variables:

  • PETIGLYPH_NO_FFMPEG_PROMPT=1
  • PETIGLYPH_TUI_DEBUG=1
  • PETIGLYPH_TUI_DEBUG_LOG=/path/to/log

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

petiglyph-0.1.1.tar.gz (241.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

petiglyph-0.1.1-py3-none-win_arm64.whl (3.2 MB view details)

Uploaded Python 3Windows ARM64

petiglyph-0.1.1-py3-none-win_amd64.whl (3.4 MB view details)

Uploaded Python 3Windows x86-64

petiglyph-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

petiglyph-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

petiglyph-0.1.1-py3-none-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

petiglyph-0.1.1-py3-none-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file petiglyph-0.1.1.tar.gz.

File metadata

  • Download URL: petiglyph-0.1.1.tar.gz
  • Upload date:
  • Size: 241.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for petiglyph-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1205b6490d5d2df85c3cac4636e9321f75c23d27c9af4f8a02dfe03baeed84f0
MD5 7a1685b57b76e7c37e179b3c64aae95c
BLAKE2b-256 f4ea4fa3a19e024395cd8e2a6f52fead71b41d943a3fdb9eeeab035d927c8190

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1.tar.gz:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file petiglyph-0.1.1-py3-none-win_arm64.whl.

File metadata

  • Download URL: petiglyph-0.1.1-py3-none-win_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for petiglyph-0.1.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 33af5898bcc8732a1a53630e3cbc2eecddd89312271f3a3e31a67c9b7db70d55
MD5 b46f8e54376fe66d4a8b9d8018fb7501
BLAKE2b-256 191d985ded5ab2db2187d9ff3678ef19dbc57c5470c7c0c64b7f0ae1bd59a5bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1-py3-none-win_arm64.whl:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file petiglyph-0.1.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: petiglyph-0.1.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for petiglyph-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 004f7a3f3be21997a1c3aef952681f3cb5be6b0aaf4310b672625155f5cdde29
MD5 9f9b52ac3087426b48e60506c4720db3
BLAKE2b-256 86cbe6101edfe5baf2872a99ab0f7af51814b2865499cf22301699516a315124

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1-py3-none-win_amd64.whl:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file petiglyph-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for petiglyph-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 157e20488c28efa546ebc3fd87681fabf0e7e46c731422f8fe8a8fc1e2e17dfd
MD5 12b10f787285cea1e368d1ac3d064017
BLAKE2b-256 46036a3bd9cd74e17b8ffd688074edb5ff809126b6884cdae9dccc7a3195d641

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file petiglyph-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for petiglyph-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db818ca47d79dea7d74723529319d4e7a697cf4bc1ac3c06d5d15da1816527b4
MD5 4c787e583a197a8b2d235ca306955749
BLAKE2b-256 eb3adb2bb4089569ca584bb0c67136c26e88e7dcf19b06932525dbc4454fbc25

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file petiglyph-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for petiglyph-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14297c06367a4a48e1110f7b075ec626d5e0a056aa5040490c22d1209c3cab95
MD5 2085d186d5126115e257f93452902642
BLAKE2b-256 8b5c159e1accab5eff65bfb292b49cb35f64b038936f1b883594364e7d9c38c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1-py3-none-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file petiglyph-0.1.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for petiglyph-0.1.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d58a723c2bfb04b3a78db0128a21141784e7ac56b4f0f42f0cb925582f630312
MD5 139a6f92107ae65dd8e256c542b0b872
BLAKE2b-256 fcf9f85023922ee814a1ba9a44882998f2b7ad158f4e6a582afb186c77627c7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for petiglyph-0.1.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: pypi-publish.yml on petipoua/petiglyph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page