Safari and a Java printreturn


I need to display a long text string over a pixmap. I want to wrap the text so it appears as a paragraph. I've tried both DrawText() and CGContextShowText() to draw the string (I embedded linefeeds in the string) ... but they do not seem to do line-wrapping automatically.

Does Mac have a function that will do line-wrapping automatically?

If not, I am happy to do my own line-breaking, but in that case my question becomes: Does Mac have a function that - given a string and font - will return the width and height (in pixels) of the displayed string?