Use IGraphicText to display styled text strings as static graphics. IGraphicText currently displays text as a single line, ignoring text following any new-line characters.
bool
IHelloWorldView::drawContents (IGrafPort& port) const
{
IText string("Hello World!");
string.addStyles(ITextTypeFaceStyle("Helvetica"));
string.addStyles(ITextPointSizeStyle(18), 0, 5);
IGraphicText hello(string, IGraphicText::kSingleLine);
hello.setLocation(IGPoint2D(30, 30));
hello.draw(port);
return true;
}