Class: NSParagraphStyle
Overview
The NSParagraphStyle class and its subclass NSMutableParagraphStyle encapsulate the paragraph or ruler attributes used by the NSAttributedString classes. Instances of these classes are often referred to as paragraph style objects or, when no confusion will result, paragraph styles.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- alignment
readonly
The text alignment of the receiver.
-
- baseWritingDirection
readonly
The base writing direction for the receiver.
-
- firstLineHeadIndent
readonly
The indentation of the first line of the receiver.
-
- headIndent
readonly
The indentation of the receiver’s lines other than the first.
-
- hyphenationFactor
readonly
The paragraph’s threshold for hyphenation.
-
- lineBreakMode
readonly
The mode that should be used to break lines in the receiver.
-
- lineHeightMultiple
readonly
The line height multiple.
-
- lineSpacing
readonly
The space between lines in the receiver (commonly known as leading).
-
- maximumLineHeight
readonly
The receiver’s maximum line height.
-
- minimumLineHeight
readonly
The receiver’s minimum height.
-
- paragraphSpacing
readonly
The space after the end of the paragraph.
-
- paragraphSpacingBefore
readonly
The distance between the paragraph’s top and the beginning of its text content.
-
- tailIndent
readonly
The trailing indentation of the receiver.
Class Method Summary (collapse)
-
+ defaultParagraphStyle
Returns the default paragraph style.
-
+ defaultWritingDirectionForLanguage:
Returns the default writing direction for the specified language.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (NSTextAlignment) alignment (readonly)
The text alignment of the receiver. (read-only) Natural text alignment is realized as left or right alignment depending on the line sweep direction of the first script contained in the paragraph.
- (NSWritingDirection) baseWritingDirection (readonly)
The base writing direction for the receiver. (read-only) If you the value of this property is NSWritingDirectionNaturalDirection, the receiver resolves the writing direction to either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, depending on the direction for the user’s language preference setting.
- (Float) firstLineHeadIndent (readonly)
The indentation of the first line of the receiver. (read-only) This property contains the distance (in points) from the leading margin of a text container to the beginning of the paragraph’s first line. This value is always nonnegative.
- (Float) headIndent (readonly)
The indentation of the receiver’s lines other than the first. (read-only) This property contains the distance (in points) from the leading margin of a text container to the beginning of lines other than the first. This value is always nonnegative.
- (Float) hyphenationFactor (readonly)
The paragraph’s threshold for hyphenation. (read-only) Hyphenation is attempted when the ratio of the text width (as broken without hyphenation) to the width of the line fragment is less than the hyphenation factor. When the paragraph’s hyphenation factor is 0.0, the layout manager’s hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.
- (NSLineBreakMode) lineBreakMode (readonly)
The mode that should be used to break lines in the receiver. (read-only) This property contains the line break mode to be used laying out the paragraph’s text.
- (Float) lineHeightMultiple (readonly)
The line height multiple. (read-only) The natural line height of the receiver is multiplied by this factor (if positive) before being constrained by minimum and maximum line height. The default value of this property is 0.0.
- (Float) lineSpacing (readonly)
The space between lines in the receiver (commonly known as leading). (read-only) This property contains the space in points added between lines within the paragraph. This value is always nonnegative
- (Float) maximumLineHeight (readonly)
The receiver’s maximum line height. (read-only) This property contains the maximum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value is always nonnegative. The default value is 0.Glyphs and graphics exceeding this height will overlap neighboring lines; however, a maximum height of 0 implies no line height limit. Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.
- (Float) minimumLineHeight (readonly)
The receiver’s minimum height. (read-only) This property contains the minimum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value is always nonnegative
- (Float) paragraphSpacing (readonly)
The space after the end of the paragraph. (read-only) This property contains the space (measured in points) added at the end of the paragraph to separate it from the following paragraph. This value is always nonnegative. The space between paragraphs is determined by adding the previous paragraph’s paragraphSpacing and the current paragraph’s paragraphSpacingBefore.
- (Float) paragraphSpacingBefore (readonly)
The distance between the paragraph’s top and the beginning of its text content. (read-only) This property contains the space (measured in points) between the paragraph’s top and the beginning of its text content. The default value of this property is 0.0.
- (Float) tailIndent (readonly)
The trailing indentation of the receiver. (read-only) If positive, this value is the distance from the leading margin (for example, the left margin in left-to-right text). If 0 or negative, it’s the distance from the trailing margin.For example, a paragraph style designed to fit exactly in a 2-inch wide container has a head indent of 0.0 and a tail indent of 0.0. One designed to fit with a quarter-inch margin has a head indent of 0.25 and a tail indent of –0.25.
Class Method Details
+ (NSParagraphStyle) defaultParagraphStyle
Returns the default paragraph style. The default paragraph style has the following default values:Subattribute Default Value Alignment NSNaturalTextAlignment Tab stops (Mac OS X only) 12 left-aligned tabs, spaced by 28.0 points Line break mode NSLineBreakByWordWrapping All others 0.0 See individual method descriptions for explanations of each subattribute.
+ (NSWritingDirection) defaultWritingDirectionForLanguage(languageName)
Returns the default writing direction for the specified language.