Attribute属性

属性 作用 value对应对象
NSFontAttributeName 字体 UIFont
NSParagraphStyleAttributeName 段落样式 NSParagraphStyle
NSForegroundColorAttributeName 前景色 UIColor
NSBackgroundColorAttributeName 背景色 UIColor
NSObliquenessAttributeName 倾斜 NSNumber
NSExpansionAttributeName 扁平化 NSNumber:扁平比例
NSStrokeWidthAttributeName 填充(描边,加粗) NSNumber:正数为空心(描边),负数为填充(加粗)
NSStrokeColorAttributeName 填充颜色 UIColor
NSKernAttributeName 间距 NSNumber
NSUnderlineStyleAttributeName 下划线 枚举:默认为NSUnderlineStyleNone
NSUnderlineColorAttributeName 下划线颜色 UIColor
NSStrikethroughStyleAttributeName 删除线 枚举:默认为NSUnderlineStyleNone
NSStrikethroughColorAttributeName 删除线颜色 UIColor
NSLigatureAttributeName 连笔 NSNumber(0或1)
NSShadowAttributeName 阴影 NSShawdow
NSTextEffectAttributeName 设置文本特殊效果,目前只有图版印刷效果可以用 NSString
NSAttachmentAttributeName 设置文本附件,常用插入图片 NSTextAttachment
NSLinkAttributeName 链接 NSURL和NSString
NSBaselineOffsetAttributeName 基准线偏移 NSNumber
NSWritingDirectionAttributeName 文字方向 NSArray*
NSVerticalGlyphFormAttributeName 水平或者竖直文本 NSNumber @1或@(YES)竖直 @0或@(NO)水平

参考