On 6/5/07, David Arnold wrote:
All,
In working through the beginning chapters of the metafun manual, I am getting a very unusual effect when I open the resulting pdf file in Preview on Mac OS X. Here's a snapshot of what I see.
http://online.redwoods.edu/instruct/darnold/context/meta.gif
In acrobat, it looks fine.
http://online.redwoods.edu/instruct/darnold/context/meta.pdf
Any thoughts?
Hello, It all boils down to \starttext \startMPcode z0 = (0.5cm,1.5cm) ; z1 = (2.5cm,2.5cm) ; z2 = (6.5cm,0.5cm) ; z3 = (2.5cm,1.5cm) ; draw z0---z1---z2---z3---cycle withpen pencircle scaled 5pt; \stopMPcode \stoptext resulting in newpath 14.17323 42.51968 moveto 14.17139 42.52553 70.85913 70.86505 70.86613 70.86613 curveto 70.88313 70.86877 184.25645 14.18352 184.25194 14.17323 curveto 184.2461 14.15994 70.87599 42.51889 70.86613 42.51968 cureveto 70.86118 42.52008 14.17513 42.5137 14.17323 42.51968 curveto closepath If you ask me, this looks pretty much like a rendering bug in Mac's Preview (if anyone bothers about that, please do that), but on the other hand metapost could have generated a shorter & cleaner output as well: newpath 14.17323 42.51968 moveto 70.86613 70.86613 lineto 184.25194 14.17323 lineto 70.86613 42.51968 lineto 14.17323 42.51968 lineto closepath I suspect that the problem lies in control points of bezier curve which are way too close to original points and thus lead to problems with numerical precision, but I didn't experiment much deeper, so my assumption might be wrong. Taco? Mojca PS: I'm using mp 0.993 from TeXLive, but Supelec was down, so I wasn't able to try it with the latest metapost version.
\setuppapersize[S6][S6]
\usetypescriptonce [map] [times,helvetica,palatino] [texnansi] \usetypescriptonce [serif] [times] [name,texnansi] \usetypescriptonce [sans] [helvetica] [name,texnansi] \usetypescriptonce [palatino] [texnansi]
\setupbodyfont [palatino,10pt]
\startbuffer[mpenv] \startMPenvironment \usetypescriptonce[map][times,helvetica,palatino][texnansi] \usetypescriptonce[serif][times][name,texnansi] \usetypescriptonce[sans][helvetica][name,texnansi] \usetypescriptonce[palatino][texnansi] \setupbodyfont[palatino,10pt] \definefont[RotFont][RegularBold] \stopMPenvironment \stopbuffer
\definefont[RotFont][RegularBold]
\getbuffer[mpenv]
\setupcolors[state=start]
\starttext
\startuseMPgraphic{axis} tickstep := 1cm ; ticklength := 2mm ; drawticks unitsquare xscaled 8cm yscaled 3cm ; tickstep := tickstep/2 ; ticklength := ticklength/2 ; drawticks unitsquare xscaled 8cm yscaled 3cm ; \stopuseMPgraphic
\startuseMPgraphic{points} z0 = (0.5cm,1.5cm) ; z1 = (2.5cm,2.5cm) ; z2 = (6.5cm,0.5cm) ; z3 = (2.5cm,1.5cm) ; \stopuseMPgraphic
\startuseMPgraphic{path} str := "z0---z1---z2---z3---cycle" ; \stopuseMPgraphic
\startbuffer \startlinecorrection[blank] \startMPcode string str ; defaultfont := "\truefontname{Mono}" ; \includeMPgraphic{axis} \includeMPgraphic{points} \includeMPgraphic{path} label.lft(str,(14.5cm,2.5cm)) ; drawwholepath scantokens(str) ; \stopMPcode \stoplinecorrection \stopbuffer
\getbuffer
\stoptext