From looking at http://www.imagemagick.org/Usage/text/ it appears ImageMagick does everything that I need. However I'm not certain how achieve similar results to what's shown there using the C++ api.
I'm trying to figure out how to enable word wrapping. For example, here is the small bit I'm playing with right now:
Code: Select all
std::string text="Hello World"; //parameter coming in at run-time
Magic::Image image;
image.magick("RGBA");
image.size("50x100"); //how do I determine the size needed before rendering the text? Or can it be sized automatically?
image.annotate(text, Magick::NorthWestGravity);
I'd also like to know how to determine the height needed to the hold the rendered text (with wrapping on, and a given width), so I can size the image appropriately tall to hold everything.