I believe I've seen one or more utilities, possibly command-line or Applescript, which will take a string and create, for example, an image containing that text with the specified font size, etc.
I can't find it again. Does anyone have a hint?
ImageMagick doesn't come with OS X, but it should though.
If you have to specify some more complex styles, using webkit2png might be easier.