富文本属性Attributes
1、NSFontAttributeName: 设置字体字号
2、NSForegroundColorAttributeName : 设置文字颜色
3、NSKernAttributeName: 设置字符间距
4、NSParagraphStyleAttributeName: 设置段落样式
样式有:lineSpacing 行间距、paragraphSpacing 段落间距、alignment 对齐方式等
5、NSBackgroundColorAttributeName: 设置背景颜色
6、NSStrokeColorAttributeName: 设置文字描边颜色
注意:如果需要使文字空心则需和NSStrokeWidthAttributeName(设置描边宽度)一起使用
7、NSStrikethroughStyleAttributeName:添加删除线
8、NSUnderlineStyleAttributeName:添加下划线
9、NSShadowAttributeName 设置阴影属性
注意:该属性单独设置不太好用,可以和NSVerticalGlyphFormAttributeName(横竖排设置)、NSObliquenessAttributeName(设置字体倾斜)、NSExpansionAttributeName(设置字体加粗)等属性一起搭配使用
10、NSBackgroundColorAttributeName :设置文字背景颜色
11、NSAttachmentAttributeName:设置文本附件
1、NSFontAttributeName: 设置字体字号
2、NSForegroundColorAttributeName : 设置文字颜色
3、NSKernAttributeName: 设置字符间距
4、NSParagraphStyleAttributeName: 设置段落样式
样式有:lineSpacing 行间距、paragraphSpacing 段落间距、alignment 对齐方式等
5、NSBackgroundColorAttributeName: 设置背景颜色
6、NSStrokeColorAttributeName: 设置文字描边颜色
注意:如果需要使文字空心则需和NSStrokeWidthAttributeName(设置描边宽度)一起使用
7、NSStrikethroughStyleAttributeName:添加删除线
8、NSUnderlineStyleAttributeName:添加下划线
9、NSShadowAttributeName 设置阴影属性
注意:该属性单独设置不太好用,可以和NSVerticalGlyphFormAttributeName(横竖排设置)、NSObliquenessAttributeName(设置字体倾斜)、NSExpansionAttributeName(设置字体加粗)等属性一起搭配使用
10、NSBackgroundColorAttributeName :设置文字背景颜色
11、NSAttachmentAttributeName:设置文本附件
12、NSTextEffectAttributeName: 设置文本特殊效果
13、NSWritingDirectionAttributeName:设置文字方向
以上的富文本属性总结的并不是很全面,但是基本上常用的都列举出来了