A lightweight tool to convert text into plotter / CNC friendly G-code with a live Qt preview.
https://github.com/oe7set/Text2Gcode/releases/latest
Prebuilt single-file binaries (PyInstaller):
| Platform | File | Download (latest) |
|---|---|---|
| Windows x64 | Text2Gcode-windows-x64.exe |
Download |
| Linux x64 | Text2Gcode-linux-x64 |
Download |
Text2Gcode converts a single line of text into basic G-code moves (G0/G1) suitable for pen plotters, light engraving, or CNC simulation. It offers font selection, automatic size fitting, adjustable line width preview, and direct export.
- System font selection (Qt
QFontComboBox) - Adjustable font size or automatic best fit via max width/height (binary search)
- Live vector preview with consistent on-screen line width scaling
- Configurable line width (visual only, not tool diameter compensation)
- Clipboard export
- Save as
.g/.gcode - Dimension display (mm) based on a fixed scale factor
- Simple, dependency-light codebase
- Text is converted to a
QPainterPath - Path geometry is scaled (default:
0.1units → mm) - Each path element is emitted as rapid (
G0) or linear (G1) move - Pen up/down simulated via Z moves (
safe_z/cut_z) - Output ends with
M2
- Python 3.8+
- PySide6
- (Optional)
uvfor fast, reproducible env management
Install uv:
# Linux / macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# or Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Clone & sync & run:
git clone https://github.com/oe7set/Text2Gcode.git
cd Text2Gcode
uv venv
uv sync
uv run src/main.py- Enter text
- Choose font family
- Option A: Set font size
Option B: Enable "Max Dimensions" and define width / height (mm) - Adjust preview line width
- Click "Generate G-Code"
- Copy or save
| Parameter | Purpose |
|---|---|
Scale (internal 0.1) |
Converts font units to mm |
| Line width | Only affects preview stroke |
| Safe Z / Cut Z | Hardcoded in path_to_gcode (can be extended) |
| Feedrate | Single uniform feed (F500 default) |
Always dry-run or simulate G-code before sending it to real hardware.
Pull Requests welcome:
- Fork
- Create feature branch
- Commit clean changes
- Open PR
MIT License - see LICENSE file for details.
Copyright © 2025.
Erwin Spitaler (OE7SET)
📧 erwin.spitaler@outlook.com
📡 vy 73 de OE7SET
Enjoy precise text-to-gcode conversion with a minimal, transparent codebase.

