Invoke rendering of path effects in Inkscape via command line

28 Views Asked by At

I have an Inkscape SVG file with a certain layout. I would like to be able to change text within the SVG and export it to PNG via commandline. While I am able to change the text in the SVG itself, it seems as if the path effects are not applied.

My SVG contains a text that has a Bounding Box and an Offset as live path effect. It looks pretty much like this in the original file:

<g
       id="g4291"
       inkscape:label="Headline"
       transform="translate(-10.741798,-10.659774)"
       style="display:inline"><path
         style="fill:#ffffff;stroke:none;stroke-width:1.915;stroke-linecap:square;stroke-opacity:1"
         id="rect3616"
         width="262.6636"
         height="151.91896"
         x="-215.10019"
         y="-93.487274"
         inkscape:path-effect="#path-effect3706;#path-effect3720"
         class="UnoptimicedTransforms"
         d="m 107.30469,-64.714844 v 49.285156 H 361.2168 v -49.285156 z"
         sodipodi:type="rect"
         transform="translate(-90.575195,244.21146)" /><text
         xml:space="preserve"
         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.7556px;line-height:0.94;font-family:'Bebas Neue';-inkscape-font-specification:'Bebas Neue';text-align:start;text-anchor:start;white-space:pre;inline-size:253.113;display:inline;stroke-width:0.264583"
         x="114.29417"
         y="-43.084248"
         id="text3672"
         class="UnoptimicedTransforms"
         transform="translate(-90.575195,244.21146)"><tspan
           x="114.29417"
           y="-43.084248"
           id="tspan5154">This is a </tspan><tspan
           x="114.29417"
           y="-24.513982"
           id="tspan5156">quite long sample text</tspan></text></g>

My idea was to alter the <tspan> via command line from

<tspan
           x="114.29417"
           y="-43.084248"
           id="tspan5154">This is a </tspan><tspan
           x="114.29417"
           y="-24.513982"
           id="tspan5156">quite long sample text</tspan>

to

<tspan
           x="114.29417"
           y="-43.084248"
           id="tspan5154">This is a quite long sample text</tspan>

I know that the resulting SVG looks good to me. However, the bounding box did not adjust. I can fix that by opening the file, clicking the text, adding one letter and delete it immediately again. Thus, my guess is that there is some kind of "refresh the live path, please"-action that I would like to invoke after changing the text.

Is this possible anyhow or am I on the wrong path trying to change text in my SVG?

What I have done so far: I have altered the SVG via command line, ran inkscape --export-type="png" myfile.svg but see a non-fitted bounding box around the text. After altering text in the GUI, the bounding box is adjusted as desired.

0

There are 0 best solutions below