Re: Linearly Scaling Text
Re: Linearly Scaling Text
- Subject: Re: Linearly Scaling Text
- From: Kyle Sluder <email@hidden>
- Date: Wed, 25 May 2011 14:42:59 -0700
On Wed, May 25, 2011 at 2:37 PM, Ajay Sabhaney <email@hidden> wrote:
> Currently, zooming modifies the font sizes in the attributed string. I.e. if the text in a particular text box is 12pt at 100%, then zooming to 200% increases the font size to 24pt. Image representations of text are generated by using NSLayoutManager's drawGlyphsForGlyphRange:atPoint: method to draw the text to an image. All text box image representations are rendered as if the zoom level is the max zoom level, so that regardless of the zoom level, the quality of the text is always high.
>
> Everything works great, except that the text in a text box while it is being edited does not always perfectly overlap with the text from the image representation. The reason for this seems to be that the glyph metrics (particularly glyph advancement, line height, and baseline offset) do not scale linearly.
You will need to re-render your image representations every time the
zoom factor changes.
--Kyle Sluder
_______________________________________________
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