开发者

How do you change the font of an NSTextView without changing the current content?

Everytime I use -setFont: or -setFont:Range: on my NSTextView, it does change the font, but it shouldn't. I 开发者_开发知识库just want to change the font the user is typing with.

For example, if the user types 'hi' it uses the default Helvetica font. When I change the font to Times New Roman it changes that 'hi' into Times New Roman. I don't want that. I just want that, from now on, when the user types, Times New Roman is used instead of Helvetica.


I think you might want to use -[NSTextView setTypingAttributes:] instead. You should also make sure your text view is set as rich text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜