IDLtoAI

IDLtoAI is a JavaScript utility for Adobe Illustrator which automates the process of importing IDL produced EPS files into Adobe Illustrator.

Why would I want to use this script?

In most cases, you probably won't. IDL by itself can produce decent EPS graphics, perfectly suitable for presentations and submission to journals. For color figures, you need to change the mode to CMYK rather than RGB, but you don't need a script for that. If you use the IDL vector fonts, this script will also be irrelevant.

However, if you want to change the fonts in an IDL EPS file with Postscript fonts, it's tricky to do so in a way that looks good. When IDL writes Postscript text to an EPS file, it positions each bit of text in a way that makes sense for the original font and font size. If you use superscript or subscript text, or Greek symbols, then a single title or label will be split up into many different text items, with the placement of each item controlled by a different anchor on the page.

If the font or font size is changed in Illustrator, the anchor placement of text items doesn't change, and the text can look misaligned.


For example: the figure below is produced in IDL using PostScript output.

Original IDL EPS file


If you simply select all of the text in Illustrator and change the font to Myriad Pro (the default Illustrator font), the superscripts and subscripts move out of alignment (in some cases, significantly so) and text which was nicely centered is now off center (look closely at the plot title). Sometimes strange things happen like one random letter (the "s" in the word "characters") splitting off of its group.

IDL EPS file modified by hand


With the IDLtoAI script, the different text items are gathered into single items, subscripts and superscripts are kept as properties of the characters in the merged text items, and centering is preserved. The file color mode is also changed to print-ready CMYK and the modified file is saved in a new Illustrator EPS document.

IDL EPS file modified by script


Please let me know if you find this script useful, or if you have any problems while trying to use it. The test example EPS file is available here.

This code was created using Illustrator CS5 on a Mac and has not been tested using other software or hardware. IDLtoAI is a Javascript and is available as a Gist snippet from GitHub. The source code is embedded below. Download links are available at the bottom of the embedded code.

Back to homepage

SSL logo