Re: Linearly Scaling Text
Re: Linearly Scaling Text
- Subject: Re: Linearly Scaling Text
- From: Aki Inoue <email@hidden>
- Date: Wed, 25 May 2011 14:45:04 -0700
Also, you should disable screen font substitution via -[NSLayoutManager setUsesScreenFont:NO].
This is the main source of glyph advancement differences you're seeing.
Aki
On 2011/05/25, at 14:41, Douglas Davidson wrote:
>
> 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
_______________________________________________
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