TTF フォントからテキストを作成し、それを静的 SVG パスに変換するにはどうすればよいですか? 誰でもイラストレーターで開いて単語を (.SVG として) 見ることができるように。
私たちのサーバーは Debain で、バックエンドのコーディングには主に PHP を使用しています。
Imagemagick または Inkscape を喜んで使用します。
TTF フォントからテキストを作成し、それを静的 SVG パスに変換するにはどうすればよいですか? 誰でもイラストレーターで開いて単語を (.SVG として) 見ることができるように。
私たちのサーバーは Debain で、バックエンドのコーディングには主に PHP を使用しています。
Imagemagick または Inkscape を喜んで使用します。
これを試して:
inkscape template.svg --export-text-to-path --export-id=maintext --export-pdf=new_file.pdf
今、私は知っています、私は知っています、あなたはあなたがsvg出力が欲しいと言いました...私はオプションを試しました:
--export-plain-svg=new_file.svg
しかし、Inkscapeのmanページによると:
-T, --export-text-to-path
Convert text objects to paths on export, where applicable (for PS, EPS, and PDF export).
Soooo ...プレーンなsvgエクスポートを取得できず、テキストをパスにエクスポートできません:S ...ところで、これはバグとして埋める必要があります。
PDFを提供するか、もう一度電話することができます。
inkscape -l new_file.svg new_file.pdf
それは...私は知っています、かなり愚かです。いいえ、本当に、Inkscapeにバグを報告してください:P
これはInkscapeテンプレートの例です。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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"
version="1.1"
width="440.29297"
height="39.824219"
id="svg2">
<defs
id="defs4" />
<metadata
id="metadata7">
<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>
<text
x="-3.4374955"
y="30.390625"
id="maintext"
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:[FONT_PLACEHOLDER]"><tspan
x="-3.4374955"
y="30.390625"
id="tspan3006"
style="fill:#000000">[TEXT_PLACEHOLDER]</tspan></text>
</svg>
敬具。
また、 inkscapeにファイルをGUI モードで開いてからコマンドを発行するように指示することもできます。次のコマンド ライン入力は、svg を開き、すべてのノードを選択して、パスに変換します。これにより、変換された svg を svg に保存することができます。
inkscape -f your.svg --with-gui --verb EditSelectAll --verb ObjectToPath --verb FileSave --verb FileQuit
これはファイルを上書きすることに注意してください。