A python library to convert text to laser. Single stroke fonts or ttf, control of position, typographic sizing, filling.
  • Python 98.4%
  • Makefile 1%
  • Dockerfile 0.6%
Find a file
pp-text2laser agent 971beb123c
Some checks failed
ci / test (push) Failing after 10s
ci / release (push) Has been skipped
ci / image (push) Has been skipped
ci / package (push) Has been skipped
ci / examples (push) Has been skipped
feat: demo has custom fonts
2026-10-24 18:13:52 +02:00
.forgejo/workflows feat(examples): ✨ sequence.sh runs the server examples in make examples and CI 2026-10-13 21:54:19 +02:00
docs feat: demo has custom fonts 2026-10-24 18:13:52 +02:00
fonts feat: demo has custom fonts 2026-10-24 18:13:52 +02:00
src/pp_text2laser fix(filling): 🐛 the ground around an outline letter no longer runs through its body 2026-10-04 20:26:50 +02:00
tasks fix(examples): 🐛 the Redis sink of 02-flask-redis writes LJ's line format 2026-10-24 18:13:52 +02:00
tests feat(examples): ✨ sequence.sh runs the server examples in make examples and CI 2026-10-13 21:54:19 +02:00
tools docs: 📝 documentation rewritten: true, progressive, examples that run 2026-10-04 21:57:42 +02:00
.dockerignore docs: 📝 five numbered pages, two standard files, and twelve tests that 2026-10-03 08:51:54 +02:00
.gitignore docs(examples): 🐛 make example runs again: run.sh sources lib.sh 2026-10-04 21:57:18 +02:00
AGENTS.md docs: 📝 AGENTS says where things are, not how far they got, and the font order is confirmed 2026-10-06 20:05:13 +02:00
CHANGELOG.md chore(release): 🔖 v1.2.0 2026-10-13 20:05:20 +00:00
cliff.toml chore(cliff): 🔧 only feat and fix release, and the table git-cliff ignored is gone 2026-10-04 14:59:24 +02:00
CONTRIBUTING.md docs: 📝 documentation rewritten: true, progressive, examples that run 2026-10-04 21:57:42 +02:00
Dockerfile refactor: 🔧 one renderer, one version, and an examples framework that 2026-10-03 22:43:42 +02:00
Dockerfile.coverage build(coverage): ✨ make coverage, and a coverage report in CI that never fails it 2026-10-06 20:17:39 +02:00
Dockerfile.lint fix(lint): 🐛 the lint image copies a directory that no longer exists 2026-10-03 22:43:42 +02:00
LICENSE build: the package, GPLv3, and its chain in the pipeline 2026-09-29 10:04:40 +02:00
Makefile build(coverage): ✨ make coverage, and a coverage report in CI that never fails it 2026-10-06 20:17:39 +02:00
pyproject.toml build(coverage): ✨ make coverage, and a coverage report in CI that never fails it 2026-10-06 20:17:39 +02:00
README.md feat(examples): ✨ sequence.sh runs the server examples in make examples and CI 2026-10-13 21:54:19 +02:00
ROADMAP.md feat(examples): ✨ sequence.sh runs the server examples in make examples and CI 2026-10-13 21:54:19 +02:00
SECURITY.md docs: 📝 five numbered pages, two standard files, and twelve tests that 2026-10-03 08:51:54 +02:00
VERSION.txt chore(release): 🔖 v1.2.0 2026-10-13 20:05:20 +00:00

pp-text2laser

A Python library that turns a text request into the points a laser draws.

pip install --extra-index-url https://git.interhacker.space/api/packages/protonphoton/pypi/simple pp-text2laser
from pp_text2laser import build_converter

converter = build_converter()
frame = converter.frame({"text": "Hello", "size": 120})

print(frame.code)                   # 200: drawn as asked
print(frame.as_dict()["body"][:3])  # [x, y, color] per point; color 0 moves with the laser off

Python 3.11 or newer. Two dependencies, pyphen and fonttools. Fonts are not included; see docs/10-START_HERE.md.

Try it

With Docker and Docker Compose:

git clone https://git.interhacker.space/protonphoton/pp-text2laser.git text2laser
cd text2laser
docker compose -f docs/examples/02-flask-redis/compose.yml up -d

Open http://localhost:20000/, type a text and press View: the page draws the points the library returns. Send writes them to Redis. To stop it:

docker compose -f docs/examples/02-flask-redis/compose.yml down

docs/examples/02-flask-redis says what it shows.

The demo page: a form on the left, the points drawn on the right

Documentation

Page For
10-START_HERE installing, a first request, the glossary
20-HOW_TO_USE every request field, the strategies, the frame and its codes
30-EXTEND how it is built; your own sink, filling, font or strategy
40-TESTING the tests, the review cases, the playground
50-LIMITATIONS what does not work
ADR/ why each decision was taken
examples/ runnable examples, each in its own container
ROADMAP, CHANGELOG what is planned, what changed
CONTRIBUTING, SECURITY contributing, reporting a vulnerability

Working on it

Docker is the only prerequisite.

make test       # the test suite
make review     # the review pictures
make help       # every target

Packages: https://git.interhacker.space/protonphoton/-/packages. License: GPL-3.0-or-later, see LICENSE.