Re: Previewing an SVG generated by METAPOST
"Daniel H. Luecking" <[email protected]> Fri, 10 May 2019 19:15:24 +0000
| Newsgroups | gmane.comp.tex.metapost |
|---|---|
| Message-ID | <CY4PR04MB02650670FBC7706213B944B8B90C0@CY4PR04MB0265.namprd04.prod.outlook.com> |
This is not true in MetaPost's postscript output, and the BoundingBox in EPS and SVG are the same to 5 decimals. It seems to me that the path definition in SVG draws the path almost a point higher than it ought to be. This is assuming that in viewBox="0 0 63.410065 91.206802" the coordinates are supposed to represent the ulcorner and lrcorner of the picture. If that is the case, the initial moveto should be 0.25 90.87 (approx.) instead of 0.0 90.0 (with corresponding adjustments to other points in the path) so that the strokes (thickness and all) exactly fit in the viewBox. Seems like a bug to me, but I have only a vague idea of the SVG format and how it is supposed to be dislayed. Cheers, Dan Daniel H. Luecking [[email protected]] Department of Mathematical Sciences 1 University of Arkansas Fayetteville, AR, USA 72701-1201 ________________________________ From: metapost <[email protected]> on behalf of William Adams <[email protected]> Sent: Friday, May 10, 2019 8:51 AM To: luigi scarso Cc: MetaPost List Subject: Re: [metapost] Previewing an SVG generated by METAPOST I believe that what I should conclude is that the extent of a graphic is only calculated from the centerline of a graphic and that the clipping is to be expected if I don't explicitly adjust for it. Thanks! I'll begin to do so. William On Fri, May 10, 2019 at 9:47 AM luigi scarso <[email protected]<mailto:[email protected]>> wrote: On Thu, May 9, 2019 at 9:13 PM William Adams <[email protected]<mailto:[email protected]>> wrote: With v1.8, METAPOST allows one to create an SVG --- unfortunately, there aren't any TeX / code editors which have SVG previewers as far as I can tell. Found: https://code.google.com/archive/p/file-monitor/<https://urldefense.proofpoint.com/v2/url?u=https-3A__code.google.com_archive_p_file-2Dmonitor_&d=DwMFaQ&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=K3TwNcJ4SxqZbraK4KV6YDrco0TfwzVnCrTKAiPcasA&s=RS44fgR1aii1aLXK6-OstLQFUPsBBXxb12o-EAY5dK0&e=> but it seems to be broken in Windows 10 --- one has to switch to its window and press F5 --- is there an updated version of this program, or some other easy way to preview an SVG? An application with nice tools for this would be welcome. BTW, the file: outputtemplate := "%j-%c.svg"; prologues := 3; outputformat := "svg"; beginfig(1); z0 = (0,0); z1 = (60,40); z2 = (40,90); z3 = (10,70); z4 = (30,45); draw z0..z1..z2..z3--z4--cycle endfig; end is clipped at the top --- should it be? William the pen ? prologues := 3; outputformat := "svg"; beginfig(1); z0 = (0,0); z1 = (60,40); z2 = (40,90); z3 = (10,70); z4 = (30,45); draw z0..z1..z2..z3--z4--cycle withpen pencircle scaled 0.001pt; endfig; end -- luigi -- http://tug.org/metapost/<https://urldefense.proofpoint.com/v2/url?u=http-3A__tug.org_metapost_&d=DwMFaQ&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=TC6doj34eEZMeTCOMVYeIK4ttwYpTurqDpMOi43sP18&m=K3TwNcJ4SxqZbraK4KV6YDrco0TfwzVnCrTKAiPcasA&s=7zZ04_BTE6JIShkldUxWNVgp_tTO7Dq8zC0ToGbn2QA&e=> -- http://tug.org/metapost/