Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSTextMBS class.

Writing Direction

NSTextMBS.NSWritingDirectionLeftToRight = 0

Type Topic Plugin Version
const Cocoa Text MBS MacCocoa Plugin 8.4
One of the constants to specify the writing directions.

The writing direction is left to right.

Available in Mac OS X v10.2 and later.

NSTextMBS.NSWritingDirectionNatural = -1

Type Topic Plugin Version
const Cocoa Text MBS MacCocoa Plugin 8.4
One of the constants to specify the writing directions.

The writing direction is determined using the Unicode Bidi Algorithm rules P2 and P3. Default.

Available in Mac OS X v10.4 and later.

NSTextMBS.NSWritingDirectionRightToLeft = 1

Type Topic Plugin Version
const Cocoa Text MBS MacCocoa Plugin 8.4
One of the constants to specify the writing directions.
Example
const NSWritingDirectionNatural       = -1   // Determines direction using the Unicode Bidi Algorithm rules P2 and P3
const NSWritingDirectionLeftToRight = 0 // Left to right writing direction
const NSWritingDirectionRightToLeft = 1 // Right to left writing direction

const NSTextWritingDirectionEmbedding = 0
const NSTextWritingDirectionOverride = 2

dim t as NSTextStorageMBS = TextArea1.NSTextViewMBS.textStorage

// get hello in arabic
dim a as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithString("مرحبا")
dim m as NSMutableAttributedStringMBS = a.mutableCopy

// now set attributes for right to left
m.addAttribute t.NSWritingDirectionAttributeName, array(NSWritingDirectionRightToLeft+NSTextWritingDirectionOverride), new NSRangeMBS(0,m.Length)

// and add to textarea
t.appendAttributedString m

The writing direction is right to left.

Available in Mac OS X v10.2 and later.

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


The biggest plugin in space...