I want to import a font dynamically.
I tried like this but it does not work :
test.svg
<svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="800px" height="800px" viewBox="0 0 800 800">
<title>Text in a heart</title>
<defs>
<style type="text/css">
@font-face {
font-family: testfont;
src: url('testfont.ttf');
}
</style>
<path id="heartPath" fill="none" d="M367.386,236.209C303.31,86.667,121.172,121.558,119.973,295.124c0.664,95.325,86.73,130.957,144.918,169.065
c56.423,36.958,96.58,87.514,102.873,109.036c5.388-21.087,50.116-73.074,102.346-110.07
c57.109-40.452,145.582-73.744,144.917-169.067C613.821,120.092,428.516,92.631,367.386,236.209z"/>
</defs>
<use xlink:href="#heartPath"
fill="none" stroke="none"
fill-opacity="1" stroke-opacity="0" />
<flowRoot style="font-size:12px;text-align:justify;font-family:testfont;font-weight:normal;line-height:100%;">
<flowRegion>
<use xlink:href="#heartPath" />
</flowRegion>
<flowPara fill="red" fill-opacity="1" stroke-opacity="0">My custom text</flowPara>
</flowRoot>
</svg>
Code: Select all
inkscape -f test.svg -e test.png -y 1
or, it may be possible to set the default font from the command line?
Thank you