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.
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.
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
Installation and runtime prerequisites
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.
Distribution surfaces in this repo:
- GitHub Releases: prebuilt archives
- AUR:
petiglyph - npm:
petiglyph - PyPI:
petiglyph
Install examples:
npm install -g petiglyph
pip install petiglyph
yay -S petiglyph
Runtime requirement:
ffmpegmust be available onPATHbeforepetiglyphstarts.- Interactive runs show an OS-aware install hint when
ffmpegis missing. - To let petiglyph run the suggested install command for that run, pass
--ffmpeg-auto-install. - To suppress the one-time hint globally, set
PETIGLYPH_NO_FFMPEG_PROMPT=1.
Create a project and open the TUI
petiglyph create my-font
cd my-font
petiglyph
petiglyph with no subcommand launches the TUI. petiglyph tui does the same explicitly.
Fast path from images to a font
Import a few images as glyphs:
petiglyph glyph create \
--input ../assets/logo.png \
--input ../assets/mark.svg
Build the font artifacts:
petiglyph build
Install the built font into the current user font directory:
petiglyph install-font
Build, install, refresh font state, and print the sample text you can paste into a terminal:
petiglyph sample
First animation flow
Create an animated glyph from a GIF or video:
petiglyph animation create-standard \
--input ../assets/run.mp4 \
--fps 8 \
--name run
What the TUI is for
The TUI is the primary interface for:
- importing glyphs, grids, and animations through the Home panel workflows
- previewing glyphs without aspect-ratio distortion
- tuning per-glyph threshold and invert overrides
- building, installing, uninstalling, and sampling fonts
- selecting projects when no single manifest is auto-detected
On Windows, the Home creation workflows use a native file picker.
Command reference
Core commands:
petiglyph create <name>
petiglyph create <name> --no-launch
petiglyph
petiglyph tui
petiglyph list
petiglyph delete
petiglyph build
petiglyph sample
petiglyph install-font
petiglyph uninstall-font
petiglyph uninstall-all-fonts
petiglyph doctor
Glyph commands:
petiglyph set-threshold <image> <threshold>
petiglyph clear-threshold <image>
petiglyph glyph create --input <path> [--input <path>...]
petiglyph glyph set-threshold <image> <threshold>
petiglyph glyph clear-threshold <image>
petiglyph glyph set-invert <image> --invert on|off
Composition and animation commands:
petiglyph grid create --input <path> --rows <n> --cols <n>
petiglyph composition set <image> --rows <n> --cols <n>
petiglyph composition clear <image>
petiglyph animation create-standard --input <path> --fps <n>
petiglyph animation create-grid --input <path> --rows <n> --cols <n> --fps <n>
petiglyph animation set-fps <name> --fps <n>
petiglyph animation delete <name>
Useful build-time options:
petiglyph build --force-remap
petiglyph sample --force-remap
petiglyph install-font --force-remap
petiglyph uninstall is intentionally a hidden stub that exits with guidance to use uninstall-font or uninstall-all-fonts.
Project resolution and TUI launch behavior
Project-scoped commands accept --manifest to target a specific project.
When --manifest is omitted, petiglyph checks:
./petiglyph.toml- one directory level below the current directory
Behavior after discovery:
- exactly one project: that project is used
- zero projects: CLI commands fail with guidance; TUI opens on the Home panel
- multiple projects: CLI commands fail with guidance; TUI opens on the Home panel
list and uninstall-all-fonts are not manifest-scoped.
petiglyph and petiglyph tui require an interactive terminal. In non-TTY contexts they fail with an explicit terminal-required error.
JSON automation contract
--json is supported on:
listdeleteset-thresholdclear-thresholdglyph createglyph set-thresholdglyph clear-thresholdglyph set-invertgrid createcomposition setcomposition clearanimation create-standardanimation create-gridanimation set-fpsanimation deletebuildsampleinstall-fontuninstall-fontuninstall-all-fontsdoctor
Envelope shape:
{
"ok": true,
"command": "build",
"version": "0.1.0",
"data": {}
}
Failure rules:
- non-zero exit code
ok: false- stable top-level fields:
ok,command,version,data error.messagealways present on failures- optional
error.causes[]for nested context - no extra human-oriented logs on stdout in JSON mode
Manifest format
Default manifest values:
input_dir = "images"
out_dir = "build"
font_name = "Petiglyph"
glyph_size = 64
threshold = 64
codepoint_start = "U+100000"
Common managed sections:
[threshold_overrides]
"logo.png" = 72
[invert_overrides]
"logo.png" = true
[compositions."sheet.png"]
rows = 4
cols = 4
horizontal_bleed = "weak"
vertical_bleed = "off"
Notes:
project_idis managed automatically and may be written back to the manifest during normal reads/builds.- animation entries may also be normalized and written back during normal reads/builds.
threshold_overridesandinvert_overridesare keyed relative toinput_dir.- composition bleed defaults are
horizontal_bleed = "weak"andvertical_bleed = "off".
Supported inputs
Direct build inputs in images/:
pngjpgjpegwebpbmpgifsvg
Import-only conversion path:
avifcan be imported through CLI/TUI workflows, but it is converted to project-local.pngfiles before build input scanning.
Animated creation workflows also accept:
gifmp4movmkvwebmavim4v
Media-processing limits:
- maximum
1200extracted frames per media input - maximum
3000extracted frames per import operation
Build outputs
petiglyph build recreates out_dir and writes:
<font-slug>.ttf<font-slug>.bdfglyph-map.jsonglyph-sample.txtpreviews/*.png
It also maintains project-local lock/mapping state such as:
petiglyph.lock.petiglyph-build.lock
glyph-map.json maps source files to assigned codepoints. glyph-sample.txt contains the generated sample string.
Install, sample, and doctor
install-font:
- builds the project
- installs the
.ttfinto the current user font location - uses a project-prefixed installed family name by default
- preserves project ownership through
project_idand the Unicode registry
sample:
- builds the project
- performs a managed install
- refreshes platform font state
- prints the private-use sample string
doctor:
- runs global health checks without a manifest
- adds project-specific checks when a project is resolvable
- can repair stale locks, orphan metadata, and missing registry assignment with
--repair
uninstall-all-fonts removes managed petiglyph fonts and managed metadata for the current user.
Platform notes
Install roots:
- Linux:
~/.local/share/fonts/petiglyph/ - macOS:
~/Library/Fonts/for installed TTFs, with managed metadata under~/Library/Fonts/petiglyph/ - Windows:
%LOCALAPPDATA%/Microsoft/Windows/Fonts/petiglyph/
Clipboard backends used by the TUI:
- Linux:
wl-copyorxclip - macOS:
pbcopy - Windows: PowerShell
Set-Clipboardorclip.exe
After installing a font, fully quit and reopen terminal applications so they reload font state.
Debugging and tests
Useful docs:
Project docs:
Useful env vars:
PETIGLYPH_NO_FFMPEG_PROMPT=1PETIGLYPH_TUI_DEBUG=1PETIGLYPH_TUI_DEBUG_LOG=/path/to/logPETIGLYPH_TUI_HTY_FULL_REPAINT=1
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file petiglyph-0.1.0.tar.gz.
File metadata
- Download URL: petiglyph-0.1.0.tar.gz
- Upload date:
- Size: 244.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
460c1de1ee9204d0962ef443442659b17fbf74fa8822e6339a7ddf7b2ac8aa4b
|
|
| MD5 |
85cfd632288d4a8604cfcdb99161dd3b
|
|
| BLAKE2b-256 |
ebc1dd762d289eb9e824399c180fc2512eb667dbe15dd2ae46b21200831eed5b
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0.tar.gz -
Subject digest:
460c1de1ee9204d0962ef443442659b17fbf74fa8822e6339a7ddf7b2ac8aa4b - Sigstore transparency entry: 1753481521
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file petiglyph-0.1.0-py3-none-win_arm64.whl.
File metadata
- Download URL: petiglyph-0.1.0-py3-none-win_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7eb3c99637063978965e4b9c87f835def4387b60c4c6903fc5b9c433fdd8072
|
|
| MD5 |
80d17a3b4cf9f21f25fdedbc2fa21fc0
|
|
| BLAKE2b-256 |
d1419bbe27b866f5d1949aaf072bbae1c6de8ba866a568e4d01dbf54545fc85d
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0-py3-none-win_arm64.whl:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0-py3-none-win_arm64.whl -
Subject digest:
e7eb3c99637063978965e4b9c87f835def4387b60c4c6903fc5b9c433fdd8072 - Sigstore transparency entry: 1753481595
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file petiglyph-0.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: petiglyph-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
326332f93fde435ce506de0387addccd222600c9e29ac8cc10a99162f9974cb2
|
|
| MD5 |
c535e8a5dd5161e41b23a2c0dd99013e
|
|
| BLAKE2b-256 |
d0579300eaf6f69874128d043446131bacf867e8edbe98f8d681c1433112800c
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0-py3-none-win_amd64.whl:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0-py3-none-win_amd64.whl -
Subject digest:
326332f93fde435ce506de0387addccd222600c9e29ac8cc10a99162f9974cb2 - Sigstore transparency entry: 1753481626
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file petiglyph-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: petiglyph-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d51f2fc3e2ef5b13547873075bb909879ce3bedaa5b327db9fb99b6cf9b15cd6
|
|
| MD5 |
0f546d3dd401a810878c831c56864cc0
|
|
| BLAKE2b-256 |
9ca05dbe7c531d020253956b70766d272a44c8d5ba6e1648d472bbccd3ffb819
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
d51f2fc3e2ef5b13547873075bb909879ce3bedaa5b327db9fb99b6cf9b15cd6 - Sigstore transparency entry: 1753481641
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file petiglyph-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: petiglyph-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f7b75e708763c5d434536802c934359ca8fc419f5aa6492be3f5e345d5be70
|
|
| MD5 |
8c61b3177781c9fdaedc0a7900404f46
|
|
| BLAKE2b-256 |
ebdec727254ebfe3a269b4c49c2394681da1f53519dd72932dbf7215144dd136
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
23f7b75e708763c5d434536802c934359ca8fc419f5aa6492be3f5e345d5be70 - Sigstore transparency entry: 1753481710
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file petiglyph-0.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: petiglyph-0.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2c9c284107eba385b5c44102d7c75ea0d7aff6d8f9cfd56b50a7721b32cec0d
|
|
| MD5 |
a1430305b79e4f8cb8e083cb307c30b4
|
|
| BLAKE2b-256 |
54f1d6f6a16579526c997e67935dea858dcb5a8620d35f02e4f5e05b3aeddd16
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
b2c9c284107eba385b5c44102d7c75ea0d7aff6d8f9cfd56b50a7721b32cec0d - Sigstore transparency entry: 1753481768
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file petiglyph-0.1.0-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: petiglyph-0.1.0-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86e30bcd56fb742147c5ca4f946b36d98e4d3f2434368829282e60f1b4f9558f
|
|
| MD5 |
818f4bcd9a698a8079a26cb7a2e4feef
|
|
| BLAKE2b-256 |
5731df95b32b770cdac566c09c52084b00151a05d31bb16e09dcc4f249e3d68d
|
Provenance
The following attestation bundles were made for petiglyph-0.1.0-py3-none-macosx_10_12_x86_64.whl:
Publisher:
pypi-publish.yml on petipoua/petiglyph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petiglyph-0.1.0-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
86e30bcd56fb742147c5ca4f946b36d98e4d3f2434368829282e60f1b4f9558f - Sigstore transparency entry: 1753481681
- Sigstore integration time:
-
Permalink:
petipoua/petiglyph@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petipoua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@71fd6074ad8529abb87e00e6434aa082f4a9e423 -
Trigger Event:
workflow_dispatch
-
Statement type: