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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to