pycocoa.strs.StrAttd

Package pycocoa :: Module strs :: Class StrAttd |
[frames] | no frames]

# Class StrAttd

    object --+
             |
    basestring --+
                 |
               str --+
                     |
        object --+   |
                 |   |
      bases._Type0 --+
                     |
                   Str --+
                         |
            object --+   |
                     |   |
          bases._Type0 --+
                         |
                        StrAttd

Python `str` Type, wrapping (immutable) ObjC `NSAttributedString`.

Instance Methods
Inherited from `Str`: `copy` Inherited from `str`: `__add__`, `__contains__`, `__eq__`, `__format__`, `__ge__`, `__getattribute__`, `__getitem__`, `__getnewargs__`, `__getslice__`, `__gt__`, `__hash__`, `__le__`, `__len__`, `__lt__`, `__mod__`, `__mul__`, `__ne__`, `__repr__`, `__rmod__`, `__rmul__`, `__sizeof__`, `__str__`, `capitalize`, `center`, `count`, `decode`, `encode`, `endswith`, `expandtabs`, `find`, `format`, `index`, `isalnum`, `isalpha`, `isdigit`, `islower`, `isspace`, `istitle`, `isupper`, `join`, `ljust`, `lower`, `lstrip`, `partition`, `replace`, `rfind`, `rindex`, `rjust`, `rpartition`, `rsplit`, `rstrip`, `split`, `splitlines`, `startswith`, `strip`, `swapcase`, `title`, `translate`, `upper`, `zfill` Inherited from `bases._Type0`: `__init__`, `type2strepr` Inherited from `object`: `__delattr__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__subclasshook__`

Static Methods
a new object with type S, a subtype of T |
__new__(cls, ns_str='', **attrs) New Str from `str`, Str or `NSStr[ing]`. |

Properties
| attachment Get the baselineOffset (`str`).
| backgroundColor Get the background fill color (`Color`).
| baselineOffset Get the baselineOffset (`int` or `float`).
| font Get the font (`Font`).
| foregroundColor Get the text color (`Color`).
| kern Get the kerning (`int` or `float`).
| ligature Get the underline style (`int`).
| link Get the underline style (`NS...`).
| NS Get the ObjC instance (`NSAttributedString`).
| paragraphStyle Get the paragraph style (`...`).
| superScript Get the underline style (`int` or `float`).
| underlineStyle Get the underline style (`UnderlineStyle`).
Inherited from `bases._Type0`: `NSDelegate` Inherited from `object`: `__class__`

Method Details

### __new__(cls, ns_str='', **attrs) Static Method |
New Str from `str`, Str or `NSStr[ing]`. Returns: a new object with type S, a subtype of T Overrides: object.__new__ (inherited documentation)

Property Details

### attachment Get the baselineOffset (`str`). Get Method: attachment(self) - Get the baselineOffset (`str`). Set Method: attachment(self, attachment)

### backgroundColor Get the background fill color (`Color`). Get Method: backgroundColor(self) - Get the background fill color (`Color`). Set Method: backgroundColor(self, backgroundColor)

### baselineOffset Get the baselineOffset (`int` or `float`). Get Method: baselineOffset(self) - Get the baselineOffset (`int` or `float`). Set Method: baselineOffset(self, baselineOffset) Note: The baseline offset attribute is a literal distance, in pixels, by which the characters should be shifted above the baseline (for positive offsets) or below (for negative offsets).

### font Get the font (`Font`). Get Method: font(self) - Get the font (`Font`). Set Method: font(self, font)

### foregroundColor Get the text color (`Color`). Get Method: foregroundColor(self) - Get the text color (`Color`). Set Method: foregroundColor(self, foregroundColor)

### kern Get the kerning (`int` or `float`). Get Method: kern(self) - Get the kerning (`int` or `float`). Set Method: kern(self, kern) Note: 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.

### ligature Get the underline style (`int`). Get Method: ligature(self) - Get the underline style (`int`). Set Method: ligature(self, ligature) Note: The ligature attribute determines what kinds of ligatures should be used when displaying the string: 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.

### link Get the underline style (`NS...`). Get Method: link(self) - Get the underline style (`NS...`). Set Method: link(self, link) Note: The link attribute specifies an arbitrary object that is passed to the NSTextView method clickedOnLink:atIndex: when the user clicks in the text range associated with the NSLinkAttributeName attribute. The text view’s delegate object can implement textView:clickedOnLink:atIndex: or textView:clickedOnLink: to process the link object. Otherwise, the default implementation checks whether the link object is an NSURL object and, if so, opens it in the URL’s default application.

### NS Get the ObjC instance (`NSAttributedString`). Get Method: NS(self) - Get the ObjC instance (`NSAttributedString`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### paragraphStyle Get the paragraph style (`...`). Get Method: paragraphStyle(self) - Get the paragraph style (`...`). Set Method: paragraphStyle(self, paragraphStyle)

### superScript Get the underline style (`int` or `float`). Get Method: superScript(self) - Get the underline style (`int` or `float`). Set Method: superScript(self, superScript) Note: 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.

### underlineStyle Get the underline style (`UnderlineStyle`). Get Method: underlineStyle(self) - Get the underline style (`UnderlineStyle`). Set Method: underlineStyle(self, underlineStyle) Note: The underline attribute has only two values defined, NSNoUnderlineStyle and NSSingleUnderlineStyle, but these can be combined with NSUnderlineByWordMask and NSUnderlineStrikethroughMask to 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.