how do I define fontfamily in svg
Posted: 2013-11-25T01:46:22-07:00
Dear.
I'm trying to Svg file to Png usign command line like "convert new.svg a.png".
All thing is working fine except font part.
I did
1.add type.xml my hosting locate with perl gen file, and then add custom font file.
/home/hosting_users/ME/.magic/type.xml
<type
format="ttf"
name="MyFont"
fullname="MyFont"
family="MyFont"
glyphs="/font/MyFontx.ttf"
/>
after that
convert -font MyFont -pointsize 90 testtext a.png <--- that's working very fine.
following is failed
=================new.svg file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010 ... /svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="600" height="600">
<text x="161px" y="84px" font-family="MyFont">asdf</text>
</svg>
convert new.svg a.png <--------------------a.png showing with default font. not MyFont
Please Let me know how custom font define in svg or other way.
I'm trying to Svg file to Png usign command line like "convert new.svg a.png".
All thing is working fine except font part.
I did
1.add type.xml my hosting locate with perl gen file, and then add custom font file.
/home/hosting_users/ME/.magic/type.xml
<type
format="ttf"
name="MyFont"
fullname="MyFont"
family="MyFont"
glyphs="/font/MyFontx.ttf"
/>
after that
convert -font MyFont -pointsize 90 testtext a.png <--- that's working very fine.
following is failed
=================new.svg file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010 ... /svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="600" height="600">
<text x="161px" y="84px" font-family="MyFont">asdf</text>
</svg>
convert new.svg a.png <--------------------a.png showing with default font. not MyFont
Please Let me know how custom font define in svg or other way.