[metapost] Clipped svg output

Lutz Haseloff lutz.haseloff at toppkieker.info
Fri Jan 20 10:18:54 CET 2023


Hi Luigi,

I did read it but I'm not a programmer, sorry.

So only now it makes sense to me, that only coordinates with fractions 
are affected.

I will try to compile mpost as soon as the patch is committed.

Thank you very much again.


Greetings Lutz


Am 20.01.2023 um 09:56 schrieb luigi scarso:
>
>
> 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/d662d5fd/attachment-0001.html>


More information about the metapost mailing list.