I work on postscript objects and I need to transform lines like
109.8516 58.404 moveto
102.7108 70.7583 88.4258 67.3824 82.4704 64.0235 curveto
or
109.8516 58.404 m
102.7108 70.7583 88.4258 67.3824 82.4704 64.0235 c
in the PGF/TikZ format. I have 20,000 lines and I also need to use as few number of characters as possible. A good solution is to avoid the braces and to keep the blank spaces. Actually, I use the following code:
\def\p#1#2{\pgfqpoint{#1bp}{#2bp}}%
\def\m #1 #2 {\pgfpathmoveto{\p{#1}{#2}}}%
\def\l #1 #2 {\pgfpathlineto{\p{#1}{#2}}}%
\def\c #1 #2 #3 #4 #5 #6 {\pgfpathcurveto{\p{#1}{#2}}{\p{#3}{#4}}{\p{#5}{#6}}}%
with
\m 109.8516 58.404
\c 102.7108 70.7583 88.4258 67.3824 82.4704 64.0235
The problem: I need to use a blank space at the end of each line and I would like to avoid this blank space. Moreover, I'm not sure if my code is correct.
Complement: My idea is to create a version of the psvectorian package for PGF/TikZ. I am translating the file psvectorian.pro
to a file pgflibraryvectorian.code.tex
. All the vector ornaments are created with the pgf basic layer. Perhaps it's not a good idea and I might try to compress this file. My project is here : pgfvectorian
\input
or\read
?109.8516 58.404 m
and to get \m 109.8516 58.404. The first line come from a .eps file.109.8516 58.404 m
into\m 109.8516 58.404\end
and do\def\m#1 #2\end{\pgfpathmoveto{\p{#1}{#2}}}
Z
, for instance; so the size wouldn't be affected.