Files
waveform-draw/make-svg.sh
2025-12-07 14:59:30 +00:00

18 lines
757 B
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# usage: ./make-svg.sh 123 → creates 123.svg in the current directory
NUM=$1 # the number (or any text) you want inside the SVG
OUT="${NUM}.svg" # name the file after the number (change if you wish)
# --- 1⃣ Write the SVG XML directly ------------------------------------------------
printf '%s\n' \
'<?xml version="1.0" encoding="UTF-8"?>' \
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="100">' \
' <style>text{font-family:Arial,Helvetica,sans-serif; font-size:48px; fill:#fff;}</style>' \
' <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle">' \
"$NUM" \
' </text>' \
'</svg>' > "$OUT"
echo "✅ SVG written to $OUT"