[metapost] Clipped svg output

luigi scarso luigi.scarso at gmail.com
Fri Jan 20 09:56:26 CET 2023


On Fri, 20 Jan 2023 at 09:49, Lutz Haseloff <lutz.haseloff at toppkieker.info>
wrote:

> Hi Luigi,
>
> your hint, only to use the "positive quadrant" led me to this ugly
> workaround until mpost's svg output is debugged:
>
> def korrektur =
> z1 = llcorner currentpicture ;
> numeric dw, dh ;
> if x1 < 0: dw := abs x1; else: dw := 0 fi ;
> if y1 < 0: dh := abs y1; else: dh := 0 fi ;
> currentpicture := currentpicture shifted (dw,dh) ;
> enddef ;
> outputformat := "svg";
> outputtemplate := "%j-%c-corrected.%{outputformat}";
> for i = 17 upto 23 :
> beginfig(i)
> fill fullcircle scaled i withcolor red ;
> korrektur ;
> endfig ;
> endfor ;
> end
>
> (seems to work so far...)
>
Ah ok, but I was talking about  source/texk/web2c/mplibdir/svgout.w,
wher you can read the
@ We often need to print a pair of coordinates.

Because of bugs in svg rendering software,
:
text. I think we can use double instead of integer for dx and dy (I will
commit the patch this evening).

--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20230120/b7994343/attachment.html>


More information about the metapost mailing list.