[metapost] [beta-1.110] two bugs in SVG mode ?
Zhi-Wei Huang
zwhuang at gmail.com
Fri Nov 28 13:37:11 CET 2008
Hi,
I used mplib beta-1.110 to compile some mp files and tried to output
figures in SVG format.
It seems the SVG mode cannot handle two cases properly:
1). draw a cycled path;
2). draw a dot use draw;
case 1:
draw (100,100)--(200,100)--(200,150)--(100,150)--cycle;
draw unitsquare scaled 100;
draw fullcircle scaled 150;
these three sentences cannot create closed lines in SVG mode.
case 2:
draw (120,80) withpen pencircle scaled 3;
drawdot (60,130) withpen pencircle scaled 8;
the first one draw a line! (The endpoint is (120,80))
the second one draw dot in the correct location, while the scale is
not as expected.
Here is a simple example showing the "bugs":
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
outputformat := "svg";
outputtemplate := "%j-%c.svg";
prologues := 3;
beginfig(1);
pickup pencircle scaled 4;
draw (100,100)--(200,100)--(200,150)--(100,150)--cycle withcolor red;
pickup pencircle scaled 1;
draw unitsquare scaled 100 withcolor green;
pickup pencircle scaled 2;
draw fullcircle scaled 150 withcolor blue;
draw (120,80) withpen pencircle scaled 3;
drawdot (60,130) withpen pencircle scaled 8;
endfig;
bye.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
You can try SVG mode and EPS mode, then you will find the differences, :)
Regards,
Huang
More information about the metapost
mailing list