Here is a nicer example. It is definitely not a simple structure, though:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.1]
\draw (48.656200,67.906197)..controls (48.656200,75.199203) and (43.636700,84.164101)..(26.421900,84.164101)
..controls (13.507800,84.164101) and (6.457030,75.796898)..(6.457030,68.144501)
..controls (6.457030,63.839802) and (9.683590,62.882801)..(11.476600,62.882801)
..controls (13.507800,62.882801) and (16.378901,64.320297)..(16.378901,67.906197)
..controls (16.378901,70.656197) and (14.347700,72.808601)..(11.359400,72.808601)
..controls (10.640600,72.808601) and (10.402300,72.808601)..(10.160200,72.687500)
..controls (12.793000,78.902298) and (19.726601,81.773399)..(26.062500,81.773399)
..controls (39.570301,81.773399) and (39.570301,73.046898)..(39.570301,68.503899)
..controls (39.570301,61.449200) and (37.417999,59.179699)..(35.386700,57.027302)
..controls (27.257799,48.300800) and (24.628901,37.179699)..(24.628901,29.886700)
--(24.628901,24.148399)..controls (24.628901,21.996099) and (24.628901,21.519501)..(25.941401,21.519501)
..controls (27.257799,21.519501) and (27.257799,22.355499)..(27.257799,24.507799)
--(27.257799,28.929701)..controls (27.257799,35.984402) and (30.128901,46.503899)..(42.203098,55.472698)
..controls (45.550800,57.984402) and (48.656200,61.687500)..(48.656200,67.906197)
--cycle;
\draw (31.679701,5.859380)..controls (31.679701,8.964840) and (29.050800,11.597700)..(25.941401,11.597700)
..controls (22.355499,11.597700) and (20.085899,8.726560)..(20.085899,5.859380)
..controls (20.085899,2.269530) and (22.953100,0.000000)..(25.824200,0.000000)
..controls (29.171900,0.000000) and (31.679701,2.628910)..(31.679701,5.859380)
--cycle;
\end{tikzpicture}
\end{document}
Of course, the code by itself is not that useful, so here is how I obtained it:
I wanted to use makempy
, but I could not get it to work on my computer (debian with TeXLive 2009), so I basically imitated what it is supposed to do:
I started with this TeX document:
qmark.tex
:
\startTEXpage[scale=10000]$?$\stopTEXpage
I processed in with context
:
texexec qmark.tex
then converted the resulting pdf to postscript:
pdftops qmark.pdf
which I then converted to a metapost file with pstoedit
:
pstoedit -dt -f mpost qmark.ps > qmark.mp
The resulting mpfile was:
% Converted from PostScript(TM) to MetaPost by pstoedit
% MetaPost backend contributed by Scott Pakin <scott+ps2ed_AT_pakin.org>
% pstoedit is Copyright (C) 1993 - 2009 Wolfgang Glunz <wglunz35_AT_pstoedit.net>
% Generate structured PostScript
prologues := 1;
% Display a given string with its *baseline* at a given location
% and with a given rotation angle
vardef showtext(expr origin)(expr angle)(expr string) =
draw string infont defaultfont scaled defaultscale
rotated angle shifted origin;
enddef;
beginfig(1);
linecap := butt;
linejoin := mitered;
fill (48.656200,67.906197)..controls (48.656200,75.199203) and (43.636700,84.164101)..(26.421900,84.164101)
..controls (13.507800,84.164101) and (6.457030,75.796898)..(6.457030,68.144501)
..controls (6.457030,63.839802) and (9.683590,62.882801)..(11.476600,62.882801)
..controls (13.507800,62.882801) and (16.378901,64.320297)..(16.378901,67.906197)
..controls (16.378901,70.656197) and (14.347700,72.808601)..(11.359400,72.808601)
..controls (10.640600,72.808601) and (10.402300,72.808601)..(10.160200,72.687500)
..controls (12.793000,78.902298) and (19.726601,81.773399)..(26.062500,81.773399)
..controls (39.570301,81.773399) and (39.570301,73.046898)..(39.570301,68.503899)
..controls (39.570301,61.449200) and (37.417999,59.179699)..(35.386700,57.027302)
..controls (27.257799,48.300800) and (24.628901,37.179699)..(24.628901,29.886700)
--(24.628901,24.148399)..controls (24.628901,21.996099) and (24.628901,21.519501)..(25.941401,21.519501)
..controls (27.257799,21.519501) and (27.257799,22.355499)..(27.257799,24.507799)
--(27.257799,28.929701)..controls (27.257799,35.984402) and (30.128901,46.503899)..(42.203098,55.472698)
..controls (45.550800,57.984402) and (48.656200,61.687500)..(48.656200,67.906197)
--cycle;
fill (31.679701,5.859380)..controls (31.679701,8.964840) and (29.050800,11.597700)..(25.941401,11.597700)
..controls (22.355499,11.597700) and (20.085899,8.726560)..(20.085899,5.859380)
..controls (20.085899,2.269530) and (22.953100,0.000000)..(25.824200,0.000000)
..controls (29.171900,0.000000) and (31.679701,2.628910)..(31.679701,5.859380)
--cycle;
fill (55.277302,0.000000)--cycle;
endfig;
end
Notice that the path syntax in metapost is the same as in tikz, so I deleted
all the lines except the fill commands, and replaced the fill commands with
\draw
commands for tikz.
It should be pretty easy to make a script that does all that.
Here is the result:
