mutable attributed string - underline clearing bold
mutable attributed string - underline clearing bold
- Subject: mutable attributed string - underline clearing bold
- From: tridiak <email@hidden>
- Date: Sun, 25 Sep 2016 01:57:28 +1200
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 (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