【问题标题】:Inkscape shell - change textInkscape shell - 更改文本
【发布时间】:2021-03-16 12:50:30
【问题描述】:

Inkscape --shell 模式中是否有任何动词/动作来更改/编辑 svg 中的文本?我知道我可以直接在 svg 中完成,但是没有临时文件的 shell 模式对我来说似乎更干净。

顺便说一句,有没有机会在 shell 模式下从/向 stdin/stdout 读取/写入文件?同样的原因 - 避免温度。文件。

SVG 文件 - 几乎在底部的关键部分 - “要编辑的文本”

<?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"
   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"
   version="1.1"
   id="svg1090"
   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
   sodipodi:docname="drawing.svg">
  <defs
     id="defs1084" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.35"
     inkscape:cx="400"
     inkscape:cy="560"
     inkscape:document-units="mm"
     inkscape:current-layer="layer1"
     inkscape:document-rotation="0"
     showgrid="false"
     inkscape:window-width="1920"
     inkscape:window-height="1027"
     inkscape:window-x="-8"
     inkscape:window-y="-8"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata1087">
    <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
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <text
       xml:space="preserve"
       style="font-weight:bold;font-size:6.35px;line-height:1.25;font-family:Arial;-inkscape-font-specification:'Arial Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
       x="42.333332"
       y="46.113091"
       id="text1655"><tspan
         sodipodi:role="line"
         id="tspan1653"
         x="42.333332"
         y="46.113091"
         style="stroke-width:0.264583">text to edit</tspan></text>
  </g>
</svg>

【问题讨论】:

  • 你总是可以对它们进行 XSLT 转换而不使用 inkscape。
  • 能否提供一个有代表性的 SVG 文件进行编辑?
  • svg 添加到问题中 - 我猜可以更短

标签: shell svg subprocess inkscape


【解决方案1】:

如果您在使用各种不同的文本修改 SVG 后,请尝试使用 https://gitlab.com/Moini/nextgenerator 扩展。

它也应该可以独立运行(但从未尝试过)。

【讨论】:

    猜你喜欢
    • 2019-02-02
    • 2012-06-18
    • 2011-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多