NSString *msg= ...;
NSPoint p = ...;
NSTextStorage *textStorage = [[NSTextStorage alloc] init];
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
NSTextContainer *textContainer = [[NSTextContainer alloc] init];
[layoutManager addTextContainer:textContainer];
[textContainer release];
[textStorage addLayoutManager:layoutManager];
[layoutManager release];
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:msg];
[textStorage appendAttributedString: attributedString];
NSRange glyphRange = [layoutManager glyphRangeForTextContainer:textContainer];
[layoutManager drawGlyphsForGlyphRange: glyphRange atPoint: p];
参考:
ありがとうございました.
ttp://www.queuesoft.jp/blog/?p=62
0 件のコメント:
コメントを投稿