PATH
Documentation >
Mac OS X >
Application Kit Reference: Objective-C
- Inherits
from:
- NSAttributedString : NSObject
Declared in: - AppKit/NSAttributedString.h
- AppKit/NSTextAttachment.h
Class Description
Additions to the NSMutableAttributedString class primarily
involve setting graphical attributes, such as font, super- or subscripting,
and alignment, and making these attributes consistent after changes.
See the NSAttributedString additions description for more information.
Method Types
- Changing attributes
- - applyFontTraits:range:
- - setAlignment:range:
- - subscriptRange:
- - superscriptRange:
- - unscriptRange:
- Updating attachment contents
- - updateAttachmentsFromPath:
- Fixing attributes after
changes
- - fixAttributesInRange:
- - fixAttachmentAttributeInRange:
- - fixFontAttributeInRange:
- - fixParagraphStyleAttributeInRange:
Instance Methods
- (void)applyFontTraits:(NSFontTraitMask)mask
range:(NSRange)aRange
Applies the font attributes
specified by mask to the characters
in aRange. See
the NSFontManager class specification for a description of the font
traits available. Raises an NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - setAlignment:range:
- (void)fixAttachmentAttributeInRange:(NSRange)aRange
Cleans up attachment attributes
in aRange, removing all attachment
attributes assigned to characters other than NSAttachmentCharacter. Raises an
NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - fixFontAttributeInRange:, - fixParagraphStyleAttributeInRange:, - fixAttributesInRange:
- (void)fixAttributesInRange:(NSRange)aRange
Invokes the other fix... methods,
allowing you to clean up an attributed string with a single message. Raises an
NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - fixAttachmentAttributeInRange:, - fixFontAttributeInRange:, - fixParagraphStyleAttributeInRange:
- (void)fixFontAttributeInRange:(NSRange)aRange
Fixes the font attribute in aRange,
assigning default fonts to characters with illegal fonts for their scripts
and otherwise correcting font attribute assignments. For
example, Kanji characters assigned a Latin font are reassigned an
appropriate Kanji font. Raises an NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - fixParagraphStyleAttributeInRange:, - fixAttachmentAttributeInRange:, - fixAttributesInRange:
- (void)fixParagraphStyleAttributeInRange:(NSRange)aRange
Fixes the paragraph style attributes
in aRange, assigning the first paragraph
style attribute value in each paragraph to all characters of the
paragraph. This method extends the range as needed
to cover the last paragraph partially contained. A paragraph is
delimited by any of these characters, the longest possible sequence
being preferred to any shorter:- U+000D (
\r
or
CR)
- U+000A (
\n
or LF)
- U+2028 (Unicode line separator)
- U+2029 (Unicode paragraph separator)
\r\n
,
in that order (also known as CRLF)
Raises an
NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.
See
Also: - fixFontAttributeInRange:, - fixAttachmentAttributeInRange:, - fixAttributesInRange:
- (void)setAlignment:(NSTextAlignment)alignment
range:(NSRange)aRange
Sets the alignment characteristic
of the paragraph style attribute for the characters in aRange to alignment. When
attribute fixing takes place, this change will only affect paragraphs
whose first character was included in aRange. Raises an
NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - applyFontTraits:range:, - fixParagraphStyleAttributeInRange:
- (void)subscriptRange:(NSRange)aRange
Decrements the value of the
superscript attribute for characters in aRange by
1. Raises an NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - superscriptRange:, - unscriptRange:
- (void)superscriptRange:(NSRange)aRange
Increments the value of the
superscript attribute for characters in aRange by 1. Raises an NSRangeException
if any part of aRange lies beyond
the end of the receiver's characters.See
Also: - subscriptRange:, - unscriptRange:
- (void)unscriptRange:(NSRange)aRange
Removes the superscript attribute
from the characters in aRange. Raises an
NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See
Also: - subscriptRange:, - superscriptRange:
- (void)updateAttachmentsFromPath:(NSString
*)path
Updates all attachments based
on files contained in the RTFD file package at path.See
Also: - updateFromPath: (NSFileWrapper)