shell script for getting asy paths from font glyph data

This commit is contained in:
xenofem 2022-07-27 02:53:21 -04:00
parent b935b2190b
commit 32a940467f

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'