I have custom fonts installed on my shared server that are present in convert -list font.
Font: AmaticSC
family: Amatic SC
style: Undefined
stretch: Undefined
weight: 0
glyphs: /home/under/www/devel/jb_fonts/AmaticSC-Regular.ttf
I have a functioning type.xml in $HOME/.magick (thank you Anthony for the script) that is present first in the list on convert -list font | grep Path:
My delegates are: DELEGATES bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms lqr openexr png rsvg tiff x11 xml wmf zlib
If I run convert -font AmaticSC -pointsize 72 label:Rhiannon test.png I get correct custom font in test.png
If I create an svg using that font - the output from Illustrator is this:
<text transform="matrix(1 0 0 1 42.2021 279.9727)" fill="#2B2A2B" font-family="'AmaticSC-Regular'" font-size="24">Rhiannon</text>
So when I run convert /home/under/www/testsite/test.svg test.png - I just get a default Arial font in the png. No errors.
I've tried changing the svg code to font-family="AmaticSC" (and removing single quotes) - but I cannot get the font in the final png.
I will donate a kidney to anyone who can help.
SVG to png font madness
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: SVG to png font madness
The family name seems to contain a space.family: Amatic SC
You have tried font-family= with the partial filename and with the font name (without a space). Have you tried
Code: Select all
font-family="Amatic SC"
Also check that you don't also have a "style=" in the text tag, which might override the "font-family=".
snibgo's IM pages: im.snibgo.com