The identifiers listed in Table 1 are global
NSString constants containing the attribute names. The value class is the class of the value corresponding to that attribute.
none (no attachment)
none (no background)
1 (standard ligatures)
none (no link)
(as returned by
none (no underline)
The natures of several attributes are not obvious from name alone:
The kerning attribute indicates how much the following character should be shifted from its default offset as defined by the current character’s font; a positive kern indicates a shift farther along and a negative kern indicates a shift closer to the current character.
The ligature attribute determines what kinds of ligatures should be used when displaying the string. A value of 0 indicates that only ligatures essential for proper rendering of text should be used, 1 indicates that standard ligatures should be used, and 2 indicates that all available ligatures should be used. Which ligatures are standard depends on the script and possibly the font. Arabic text, for example, requires ligatures for many character sequences, but has a rich set of additional ligatures that combine characters. English text has no essential ligatures, and typically has only two standard ligatures, those for “fi” and “fl”—all others being considered more advanced or fancy.
The link attribute specifies an arbitrary object that is passed to the
clickedOnLink:atIndex:when the user clicks in the text range associated with the
NSLinkAttributeNameattribute. The text view’s delegate object can implement
textView:clickedOnLink:to process the link object. Otherwise, the default implementation checks whether the link object is an
NSURLobject and, if so, opens it in the URL’s default application.
The superscript attribute indicates an abstract level for both super- and subscripts. The user of the attributed string can interpret this as desired, adjusting the baseline by the same or a different amount for each level, changing the font size, or both.
The underline attribute has only two values defined,
NSSingleUnderlineStyle, but these can be combined with
NSUnderlineStrikethroughMaskto extend their behavior. By bitwise-ORing these values in different combinations, you can specify no underline, a single underline, a single strikethrough, both an underline and a strikethrough, and whether the line is drawn for whitespace or not.
© 1997, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-10-19)