Ignore the noise. Just clicked : Use addattribute:… message. Doh! Programming early in the morning is bad.
> On 25/09/2016, at 1:57 AM, tridiak <trid...@ihug.co.nz> wrote: > > 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/tridiak%40ihug.co.nz > > This email sent to trid...@ihug.co.nz _______________________________________________ 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