Archive for November, 2010

Entering and Formatting Text

In my previous posts, I’ve shown how to draw objects in Illustrator, InDesign, and Photoshop. The idea was to create generic functions that “wrap” the application-specific code. Each function takes a set of coordinate locations, and uses those coordinates to draw a path. You don’t need to know the details of the application objects properties, and methods needed to draw the path—just send an array to the function, and the function will take care of drawing the path. The resulting paths will be as close to identical as we can make them, given the differences between the applications.

In this blog post, I’ll try to do the same thing for text. I’ll introduce a set of functions for entering text and doing some minor typesetting tasks in Illustrator, InDesign, and Photoshop. Send the function a string of text, a location (as a coordinate pair), a point size, and a font name, and the application-specific code in each “flavor” of the function will take care of creating and formatting the text. Again, I’ll try to have all three applications produce the same result.

While we’re at it, I’ll show how to get a list of fonts from the application and display the font names in a a ComboBox control in the example plug-in. Think of it as a bonus.

The example extension will create a sample document and position the text at the center of the document, but you can use the example makeText functions to draw text wherever you want.

You can find the example project for this post here:


Update: This project is now available via Import>Adobe Creative Suite Extension Builder>Remote Creative Suite SDK examples.

Continue reading…