MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

SVG Authoring Tool Chain Report


A Microsoft Windows XP user has a graph with labels -- perhaps with
parenthesis or other things that Mathematica likes to render with its
own fonts -- that he or she would like to export from Mathematica in
SVG format.

Solution Instructions:

1. Copy the contents of
and $InstallationDirectory\SystemFiles\IncludeFiles\TeX\texmf\fonts\type1\wolfram
to a new folder, perhaps on the desktop.
2. Use the shareware version of CrossFont from to convert all the afm files in the new
folder to pfm and inf files as well as to convert all pfa files to pfb
3. Start -> Control Panel -> Fonts -> File -> Install New Fonts ->
Point to the new folder on the Desktop. ->Accept whatever the default
options are.
4. Export the graph as PDF.
5. Use Illustrator CS 2 to save the PDF as SVG via File->Save for Web
with my recommendation of the following options:
A. Subset (embed) only the font glyphs used in the file.
B. Select the SVG font specification.
C. Embed raster images, if there are any.
D. Use the same encoding as that of the SVG's eventual host document.

That's it.

Broken Tool Chains
The only application I have tried that can correctly create an SVG
containing Mathematica's fonts is Adobe Illustrator CS 2. Illustrator
CS 1 has problems embedding the fonts. CorelDRAW 12 creates an
incorrect SVG, even though it looks nice inside the application when
imported from EPS. PStoEdit can't embed the fonts either. Scribus
1.2.1 via Cygwin does not correctly export the Point graphics
primitive. Inkscape for Windows can't import PDF or EPS. Skencil
2004-1-20, the latest version for Windows, does not work either; I
can't remember why at this point.

Fonts Installation
Type 1 font installation into Windows is necessary because Illustrator
CS 2 does not always read Mathematica's EPS files correctly, because
Mathematica can only embed fonts in EPS files, and because Mathematica
always writes PDF files with Type 1 fonts. I am not sure if Windows
requires .pfa and .inf files.

After all of this, one might think that the SVG would look great in
Mozilla Firefox 1.5 Beta. Well, that browser's SVG implementation does
not yet support embedded fonts. The Adobe SVG viewer does support
embedded fonts. BTW, a good way to verify SVG files is to use Batik, a
Java-based cross-platform SVG toolkit. Batik is located at BTW, I did make sure to uninstall the
Mathematica fonts before I verified my SVGs in Batik. As a result, I
am fairly sure the font embedding is correctly done by Illustrator CS

Chris Chiasson

  • Prev by Date: Re: Checking for a given phrase in an expression
  • Next by Date: Re: Checking for a given phrase in an expression
  • Previous by thread: Re: Importing (and dealing with) multiple files
  • Next by thread: Grassmann Calculus / Indexed Objects / Simplify