You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Subhrajyoti Moitra <sm...@sapient.com> on 2005/12/02 11:14:33 UTC

Problems with converting SVG to PNG.

Hi,
I am converting an SVG image obtained from Adobe Illustrator.

I get a NullPointerException when I am trying to convert from SVG to
PNG. On further investigation I found out that the image uses custom
fonts.

How do we handle custom fonts in SVG?

Thanks,
Subhro.

Re: Problems with converting SVG to PNG.

Posted by th...@kodak.com.
Hi Subhro,

"Subhrajyoti Moitra" <sm...@sapient.com> wrote on 12/02/2005 05:14:33 
AM:

> I am converting an SVG image obtained from Adobe Illustrator. 
> I get a NullPointerException when I am trying to convert from SVG to 
PNG. On 
> further investigation I found out that the image uses custom fonts.
> How do we handle custom fonts in SVG? 

   The only required format for fonts in SVG is SVG fonts ;)

   Batik also supports TrueType (and rumor has it Type1 on Java 5).

   Illustrator uses something called CEF (CFF?) when it embeds fonts,
which is a weird TrueType wrapper around Type1 Font data.  Recent
versions of Batik shouldn't generate an NPE on encountering such a
thing.  I think it will warn and then ignore the font.  If you are
getting the error with Batik 1.6 it would be helpful if you could
provide the stack trace.

   Anyway if you don't mind modifying the SVG file you can replace 
the @font-face 'src' property with a url pointing to the actual 
TrueType file and it should work.  You could also convert the font 
to SVG using the ttf2svg converter that is part of the Batik package 
and reference the generated svg font file.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org