UITextView的typingArributes

来源:互联网 发布:鹏鹏扣字软件下载 编辑:程序博客网 时间:2024/05/18 04:05
@property(nonatomic,copy) NSDictionary<NSString *, id> *typingAttributes

默认设置的字体

(lldb) po self.wordView.typingAttributes{LMParagraphType = 0;NSColor = "UIExtendedGrayColorSpace 0 1";NSFont = "<UICTFont: 0x7feaf25143b0> font-family: \".SFUIText\"; font-weight: normal; font-style: normal; font-size: 14.00pt";NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n    28L,\n    56L,\n    84L,\n    112L,\n    140L,\n    168L,\n    196L,\n    224L,\n    252L,\n    280L,\n    308L,\n    336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection 0, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";NSUnderline = 0;}

如果选择粗体后,会改变字典中NSFont字段的font-weight: bold

(lldb) po self.wordView.typingAttributes{LMParagraphType = 0;NSColor = "UIExtendedGrayColorSpace 0 1";NSFont = "<UICTFont: 0x7feaf25143b0> font-family: \".SFUIText\"; font-weight: bold; font-style: normal; font-size: 14.00pt";NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n    28L,\n    56L,\n    84L,\n    112L,\n    140L,\n    168L,\n    196L,\n    224L,\n    252L,\n    280L,\n    308L,\n    336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection 0, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";NSUnderline = 0;}