1

I'm dynamically generating an SVG that includes text and a font using an embedded base-64 font-face with this method: How do I embed Google Web Fonts into an SVG?

<defs>
    <style>
        @font-face {
            font-family: 'My Font';
            src: url(data:application/font-woff;charset=utf-8;base64,...) format('woff2');
            font-weight: normal;
            font-style: normal;
        }
        text { 
            font-family: 'My Font', 'Arial', sans-serif; 
        }
    </style>
</defs>
<text>Hello World</text>

(Where ... is the long base-64 encoded string.)

When I download the file and open it in my browser (Chrome), I see the text in the correct font, but when I open the file in Adobe Illustrator (CS5), the font is not shown. Instead I see some text in Arial, the fallback font. Is Illustrator picky about some SVG formatting? Does it not know how to parse base-64 data URLs?

  • I don't think Illustrator is sold as a general SVG editor, much as it also is not a General PDF Editor, which is a similar wrong assumption. Try using a dedicated SVG editor instead. – usr2564301 Jan 13 '15 at 23:25
  • Is this a known/documented limitation of Illustrator? I suppose the only option would be a solution that converts the text to shapes (e.g. stackoverflow.com/questions/7742148/…); just wondering if that would pose a problem w/ Illustrator also. – Luke Jan 14 '15 at 15:42
  • I'd hesitate to call it a limitation. Compare with this: Illustrator can both import and export JPEGs; yet no-one dares to call it a JPEG editor (well ... almost no-one). Finding relevant information is hard because your CS5 is outdated by 3 or 4 versions (newer versions should likely do better), and SVG itself may have evolved as well. – usr2564301 Jan 14 '15 at 15:50
  • I suppose the best question might be: Is there documentation that explains which SVG v1.1 features are supported in Illustrator? – Luke Jan 14 '15 at 17:40
  • For anyone who might know about SVG support in Illustrator: graphicdesign.stackexchange.com/questions/45825/… – Luke Jan 14 '15 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.