Re: Clipped svg output

luigi scarso <[email protected]> Fri, 20 Jan 2023 09:56:26 +0100
Newsgroups gmane.comp.tex.metapost
Message-ID <CAG5iGsA8dnAOMcfsiPRyFTKqxhrdv0jdNN42qSzzTpw3x-J=uQ@mail.gmail.com>
On Fri, 20 Jan 2023 at 09:49, Lutz Haseloff <[email protected]>
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

--
http://tug.org/metapost/