shell script for getting asy paths from font glyph data

main
xenofem 2022-07-27 02:53:21 -04:00
parent b935b2190b
commit 32a940467f
1 changed files with 3 additions and 0 deletions

3
glif2asy.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
sd -f m '</contour>(\n| )*<contour>' '^^' | sd -f m '(.|\n)+<contour>' '' | sd -f m '</contour>(.|\n)+' '' | sd '^ +' '' | sd -f m '<point x="(-?[0-9]+)" y="(-?[0-9]+)"/>\n<point x="(-?[0-9]+)" y="(-?[0-9]+)"/>\n' '..controls ($1,$2) and ($3,$4)..' | sd '<point x="(-?[0-9]+)" y="(-?[0-9]+)" type="curve".*/>' '($1,$2)' | sd -- '<point x="(-?[0-9]+)" y="(-?[0-9]+)" type="line" smooth="yes"/>' '---($1,$2)' | sd -- '<point x="(-?[0-9]+)" y="(-?[0-9]+)" type="line"/>' '--($1,$2)' | tr -d '\n'