[NTG-context] Issue with rendering arrows in lmtx

Jan-Erik Hägglöf janerik.hagglof at bahnhof.se
Tue Mar 17 15:51:37 CET 2020


Hi All!

When I invoke this command

\startMPcode 
picture p ; p := lmt_svg [ filename ="pil.svg" ];
draw p;
\stopMPcode

I get weird results, the arrowhead points in wrong direction and is very tiny compared to the size it was meant to have.

Here is the .svg code from the saved file (pil.svg) made in Inkscape 0.92 for Mac OS



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   inkscape:version="1.0beta2 (2b71d25, 2019-12-03)"
   id="svg8"
   version="1.1"
   viewBox="0 0 462.85062 100.67344"
   height="100.67344mm"
   width="462.85062mm"
   sodipodi:docname="pil.svg">
  <defs
     id="defs2">
    <marker
       inkscape:stockid="Arrow2Lend"
       orient="auto"
       refY="0"
       refX="0"
       id="Arrow2Lend"
       style="overflow:visible"
       inkscape:isstock="true">
      <path
         id="path853"
         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
         transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
         inkscape:connector-curvature="0" />
    </marker>
    <marker
       inkscape:stockid="Arrow1Send"
       orient="auto"
       refY="0"
       refX="0"
       id="Arrow1Send"
       style="overflow:visible"
       inkscape:isstock="true">
      <path
         id="path847"
         d="M 0,0 5,-5 -12.5,0 5,5 Z"
         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
         transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
         inkscape:connector-curvature="0" />
    </marker>
    <marker
       inkscape:stockid="Arrow1Mstart"
       orient="auto"
       refY="0"
       refX="0"
       id="Arrow1Mstart"
       style="overflow:visible"
       inkscape:isstock="true">
      <path
         id="path838"
         d="M 0,0 5,-5 -12.5,0 5,5 Z"
         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
         transform="matrix(0.4,0,0,0.4,4,0)"
         inkscape:connector-curvature="0" />
    </marker>
  </defs>
  <sodipodi:namedview
     showgrid="false"
     inkscape:document-rotation="0"
     inkscape:current-layer="layer1"
     inkscape:document-units="px"
     inkscape:cy="-33.787703"
     inkscape:cx="722.89047"
     inkscape:zoom="0.35"
     inkscape:pageshadow="2"
     inkscape:pageopacity="0.0"
     borderopacity="1.0"
     bordercolor="#666666"
     pagecolor="#ffffff"
     id="base"
     inkscape:window-width="1440"
     inkscape:window-height="804"
     inkscape:window-x="0"
     inkscape:window-y="23"
     inkscape:window-maximized="0" />
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     id="layer1"
     inkscape:groupmode="layer"
     inkscape:label="Lager 1"
     transform="translate(141.37191,110.50081)">
    <path
       style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3.565;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
       d="m -141.36309,-96.761905 458.10714,2.267858"
       id="path830"
       inkscape:connector-curvature="0" />
  </g>
</svg>


Is there som incompatibility issues with reading those files? 

I’ve tested to open the file in SVGMaker and it renders correct there.

Regards

Janne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200317/4dda9312/attachment-0001.htm>


More information about the ntg-context mailing list