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: Jens Alfke <email@hidden>
- Date: Mon, 26 Apr 2010 13:29:43 -0700
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