Re: conflict between Core Graphics and NSView graphics
Re: conflict between Core Graphics and NSView graphics
- Subject: Re: conflict between Core Graphics and NSView graphics
- From: Aki Inoue <email@hidden>
- Date: Mon, 26 Apr 2010 14:11:01 -0700
We always us the text matrix instead of font size.
While it is true that the advancements and glyph outline could be affected by the font point size down in the font system, the CG graphics model doesn't work that way.
What we recommend is to stick to the Cocoa Text System that tries very hard to keep these inconsistencies hidden from the apps 8-).
Aki
On Apr 26, 2010, at 1:29 PM, Jens Alfke wrote:
>
> On Apr 26, 2010, at 12:50 PM, Aki Inoue wrote:
>
>> In CG, there are 3 font properties that determine the font rendering: font name, font size, and text matrix.
>> You need to manage all 3.
>
> Is the text matrix just used for special effects like obliquing? Using it to scale the text could produce the wrong results if the font has behaviors that are nonlinear with the point size, since those behaviors would be based on the font size not the scaling in the text matrix.
>
> In other words, it's possible that a glyph at 24pt is not identical to the same glyph at 12pt scaled up by a factor of 2. Some fonts change their proportions and stroke widths at different point sizes to improve legibility. (This "optical scaling" was actually common in the days of metal type, vanished with optical and computer typesetting, and has I believe returned with OpenType.)
>
> The thing developers need to keep in mind is that, if you're drawing 12pt text that's been zoomed in to 200%, you should keep the font size at 12 and scale the drawing coords by 2, instead of just changing the font size to 24.
>
> —Jens
_______________________________________________
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