Re: How to make letters appear in italics?
Re: How to make letters appear in italics?
- Subject: Re: How to make letters appear in italics?
- From: Martin Wierschin <email@hidden>
- Date: Tue, 17 Mar 2009 16:36:42 -0700
On Mar 17, 2009, at 2:16 PM, Jim Correia wrote:
In the case where you want to remove the italic attribute, you
should be using -convertFont:toNotHaveTrait:.
It actually doesn't matter, you can use the unitalic/unbold masks
with -convertFont:toHaveTrait:
On Mar 17, 2009, at 2:26 PM, Iceberg-Dev wrote:
NSFontManager *fontManager = [NSFontManager sharedFontManager];
[fontManager convertFont: [NSFont fontWithName: @"Helvetica" size:
75] toHaveTrait: NSItalicFontMask];
Does one get the same results (Italic) when you use the
NSObliquenessAttributeName attribute? Or are these totally different?
They are totally different.
NSItalicFontMask is a flag to be used with NSFontManager/NSFont. The
flag can provide a font object which generates glyphs specifically
designed by the font author to appear italic. If the font doesn't
have a proper italic face, then the original font object will be
returned.
On the other hand, NSObliquenessAttributeName is applied directly to
NSAttributedString. The value of the attribute is an actual skew
amount that affects the slant of all glyphs it is applied to, and
doesn't depend on the font. The obliqueness attribute can be used to
simulate italics for fonts that do not have such a typeface.
~Martin
_______________________________________________
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