Platforms to show: All Mac Windows Linux Cross-Platform
NSTextMBS.NSWritingDirectionRightToLeft=1
Function:
One of the constants to specify the writing directions.
Example:
Notes:
The writing direction is right to left.
Available in Mac OS X v10.2 and later.
Type | Topic | Plugin | Version |
const | Cocoa Text | MBS MacCocoa Plugin | 8.4 |
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.
Feedback: Report problem or ask question.