Re: NSTextView and font sizes?
Re: NSTextView and font sizes?
- Subject: Re: NSTextView and font sizes?
- From: Alex Rice <email@hidden>
- Date: Tue, 21 Jan 2003 11:18:29 -0700
On Tuesday, January 21, 2003, at 10:53 AM, Douglas Davidson wrote:
That insertText: is not the right method for this. insertText: is the
funnel point for text entered by the user via the keyboard, whether
directly or through an input method. Usually when the user types
text, the attributes are taken from the typing attributes. In some
cases an input method for e.g. Chinese or Japanese may need to set a
particular font, but the font size is correctly still taken from the
typing attributes.
If you want to construct complex text programmatically, you should
probably be dealing with the model object, the NSTextStorage, rather
than with the view. NSTextStorage is a subclass of
NSMutableAttributedString, so you can use any of the mutable
attributed string methods to modify it. If you are making many
changes at once, wrap them in a beginEditing/endEditing pair for
efficiency. See the NSTextStorage documentation for more information.
Ah I get it. Thanks, that works perfectly.
I have subclassed NSTextView to use for printing some attributed
strings and letting the NSTextView do the layout and most of the print
drawing method. It all happens off-screen and seems to work perfectly.
Is there any danger in this technique since NSTextView is actually a
"front-end" component of the text system?
Alex Rice <email@hidden> | Mindlube Software |
http://mindlube.com
what a waste of thumbs that are opposable
to make machines that are disposable -Ani DiFranco
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.