I have a mutable attributed string where a range is set to bold.
textFont is valid.

NSFont* bFont=[fontManager fontWithFamily:textFont.familyName 
traits:NSBoldFontMask weight:0 size:textFont.pointSize];
[mas setAttributes:@{NSFontAttributeName:bFont} range:rge];

This works.

When a set the attribute underline in a separate call that encompasses part of 
or all of the bold range, the bold effect is removed and the underline takes 
it’s place.

NSDictionary* ul=@{NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle)};
[mas setAttributes:ul range:rge2];
 
Why is the bold removed? Underline is not a font trait (unless I am wrong).
Do I have to set the bold and underline in the same call?
They are different calls because the ranges can be different.

OS 10.11.6. XCode 7.3.1. SDK latest/10.11

TIA
Mark
_______________________________________________

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

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

Reply via email to