#! /usr/bin/awk -f #function x(xc) {return xb+xc*s} #function y(yc) {return yb-yc*s} function x(xc) {return .25*xc} function y(yc) {return 750-.25*yc} BEGIN { print "%!PS-Adobe-3.0 EPSF-3.0" print "%%BoundingBox: ????" # print "%%GIMPPathBegin" print "%%EndComments" print "newpath" #/f{fill}def print "%%BeginProlog\n\ /c{curveto}def\n\ /L{lineto}def\n\ /m{moveto}def\n\ /h{closepath}def\n\ %%EndProlog" print "%%BeginSetup\n3 setlinewidth\n%%EndSetup" start=1 curved=0 } END { if (closed) print "h" # print "%%GIMPPathEnd" dup # print "gsave stroke grestore" print "stroke" # print "clip" print "%%PageTrailer\nshowpage\n%%EOF" } /^Name: / { # print "%%GIMPPath"$0 } /^#POINTS: / { # print "%%GIMPPathPoints: "$2 } /^DRAW: / { # print "%%GIMPPathDraw: "$2 } /^STATE: / { # print "%%GIMPPathState: "$2 } /^CLOSED: / { closed=$2 } /^TYPE: 1/ { if (curved) print x(x1)" "y(y1)" "x(x2)" "y(y2)" "x($4)" "y($6)" c" # print x($4)" "y($6)" L" else print x($4)" "y($6) (start?" m":" L") curved=0 start=0 next } /^TYPE: 2/ { x1=x2 y1=y2 x2=$4 y2=$6 curved=1 start=0 next } /^TYPE: 3/ { print "h" print x($4)" "y($6) " m" start=0 next }