2

What is the NSOriginalFont attribute and why does my attributed string contains it?

s{
    NSColor = "NSCalibratedWhiteColorSpace 0 1";
    NSFont = "\"ABeeZee-Regular 19.00 pt. P [] (0x608002047b30) fobj=0x128b84cd0, spc=5.70\"";
    NSParagraphStyle = "Alignment 2, 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 -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}da{
    NSColor = "NSCalibratedWhiteColorSpace 0 1";
    NSFont = "\"ABeeZee-Regular 19.00 pt. P [] (0x608002047b30) fobj=0x128b84cd0, spc=5.70\"";
    NSOriginalFont = "\"HelveticaNeue 19.00 pt. P [] (0x60000045bf60) fobj=0x128b022c0, spc=5.28\"";
    NSParagraphStyle = "Alignment 2, 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 -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}dd{
    NSColor = "NSCalibratedWhiteColorSpace 0 1";
    NSFont = "\"HelveticaNeue 19.00 pt. P [] (0x60000045bf60) fobj=0x128b022c0, spc=5.28\"";
    NSParagraphStyle = "Alignment 2, 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 -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
  • How did you create that attributedString? – Larme Dec 01 '16 at 15:43
  • 1
    `NSOriginalFont` attributes are created when the font used doesn't support one or more characters in the string. NSAttributedString adds these attributes that track what the font was "supposed" to be before a substitution to Helvetica occurred. referenced from - http://stackoverflow.com/questions/22826943/nsattributedstring-reporting-incorrect-sizes-for-uitextview-sizethatfits-and-bou – Rajat Dec 01 '16 at 15:43
  • hi, you can add as answer – Peter Lapisu Dec 01 '16 at 18:08

0 Answers0