Platforms to show: All Mac Windows Linux Cross-Platform

NSParagraphStyleMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Text MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
NSParagraphStyle and its subclass NSMutableParagraphStyle encapsulate the paragraph or ruler attributes used by the NSAttributedString classes.
Example
dim n as NSParagraphStyleMBS = NSParagraphStyleMBS.defaultParagraphStyle
MsgBox str(n.alignment) // 4 = natural

Instances of these classes are often referred to as paragraph style objects or, when no confusion will result, paragraph styles.
The mutable subclass of NSParagraphStyle is NSMutableParagraphStyle.

Alignment Modes

Constant Value Description
NSJustifiedTextAlignment 3 Fully-justified. The last line in a paragraph is natural-aligned.
NSLeftTextAlignment 0 Visually left aligned
NSNaturalTextAlignment 4 Indicates the default alignment for script.

Line Break Modes

Constant Value Description
NSLineBreakByCharWrapping 1 Wrapping occurs before the first character that doesn't fit.
NSLineBreakByClipping 2 Lines are simply not drawn past the edge of the text container.
NSLineBreakByTruncatingHead 3 Each line is displayed so that the end fits in the container and the missing text is indicated by some kind of ellipsis glyph.
NSLineBreakByTruncatingMiddle 5 Each line is displayed so that the beginning and end fit in the container and the missing text is indicated by some kind of ellipsis glyph in the middle.
NSLineBreakByTruncatingTail 4 Each line is displayed so that the beginning fits in the container and the missing text is indicated by some kind of ellipsis glyph.
NSLineBreakByWordWrapping 0 Wrapping occurs at word boundaries, unless the word itself doesn't fit on a single line.

Writing Direction

Constant Value Description
NSWritingDirectionLeftToRight 0 The writing direction is left to right.

Available in Mac OS X v10.2 and later.
NSWritingDirectionNatural -1 The writing direction is determined using the Unicode Bidi Algorithm rules P2 and P3. Default.

Available in Mac OS X v10.4 and later.
NSWritingDirectionRightToLeft 1 The writing direction is right to left.

Available in Mac OS X v10.2 and later.

Sub classes:

Some methods using this class:

Some examples using this class:

Blog Entries

Release notes


The items on this page are in the following plugins: MBS MacCocoa Plugin.


NSPanelMBS   -   NSPasteboardItemDataProviderMBS


The biggest plugin in space...