Re: Linearly Scaling Text
Re: Linearly Scaling Text
- Subject: Re: Linearly Scaling Text
- From: Douglas Davidson <email@hidden>
- Date: Wed, 25 May 2011 14:41:28 -0700
On May 25, 2011, at 2:37 PM, Ajay Sabhaney wrote:
> - Instead of trying to scale text linearly, use a transformation to scale the NSTextView and image representation appropriately. While this is easy to do with an image, I am having some issues scaling an NSTextView. I've tried subclassing NSTextView, then in the drawRect method, I apply an affine transformation, then call the super's drawRect. This almost works, except the caret acts as if no transformation was applied - it's size and position are unchanged even though the text is not. I've also tried using the NSView method scaleUnitSquareToSize: - however this produces fuzzy text.
Try taking a look at the source code for TextEdit--it's available as sample code, and it gives an example of scaling for NSTextViews.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden