fixFontAttributeInRange:
指定した範囲のフォント属性をデフォルトのフォントにします
-(void)fixFontAttributeInRange:(NSRange)aRange:
解説
指定した範囲のフォント属性をデフォルトのフォントにします。
返り値
( void )
なし
引数
( NSRange )aRange
範囲
フレームワーク
ApplicationKit
クラス
NSMutableAttributedString Additions
Instance Methods
使用可能
10.0
参照
- fixParagraphStyleAttributeInRange:
- fixAttachmentAttributeInRange:
- fixAttributesInRange:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { maStr =[[NSMutableAttributedString alloc] initWithString:@"AttributedString" attributes:nil] ; //スタイル指定 [maStr applyFontTraits:( NSBoldFontMask | NSItalicFontMask ) range:NSMakeRange(2,5)]; [myOutlet setAttributedStringValue:maStr]; [myOutlet setFont:[NSFont fontWithName:@"Courier" size:36.0]]; } - (IBAction)fix:(id)sender { [maStr fixFontAttributeInRange:NSMakeRange(0,15)]; [myOutlet setAttributedStringValue:maStr]; } @end