Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSAttributedStringMBS class.

Previous items

NSAttributedStringMBS.NSPaperSizeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

NSValue, containing NSSize.
Mac OS X v10.3 and earlier string constant is "PaperSize".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSParagraphStyleAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
// change line spacing in a Label

Var n as NSTextFieldMBS = Label1.NSTextFieldMBS
Var a as NSAttributedStringMBS = n.attributedStringValue

Var p as NSParagraphStyleMBS = a.attributeAtIndex(a.NSParagraphStyleAttributeName, 0)
Var m as NSMutableParagraphStyleMBS = p.mutableCopy
m.setLineSpacing 5

Var s as NSMutableAttributedStringMBS = a.mutableCopy
s.addAttribute(a.NSParagraphStyleAttributeName, m, new NSRangeMBS(0, s.length))

n.attributedStringValue = s

NSParagraphStyle
Default as returned by the NSParagraphStyle method defaultParagraphStyle

NSAttributedStringMBS.NSPlainTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Plain text document.

NSAttributedStringMBS.NSPrefixSpacesDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString related to HTML generation.

An Number containing an integer (default 0) representing the number of spaces per level by which to indent certain nested HTML elements.
Available in Mac OS X v10.4 and later.

NSPrefixSpacesDocumentAttribute allows some control over formatting.

NSAttributedStringMBS.NSReadOnlyDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing int. If missing or 0 or negative, not read only; 1 or more, read only.
Note that this has nothing to do with the file system protection on the file, but instead can affect how the file should be displayed to the user.
Mac OS X v10.3 and earlier string constant is "ReadOnly".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSRightMarginDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing a float, in points.
Mac OS X v10.3 and earlier string constant is "RightMargin".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSRTFDTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Rich text format with attachments document.

NSAttributedStringMBS.NSRTFTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Rich text format document.

NSAttributedStringMBS.NSShadowAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSShadow
Default nil, no shadow.
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSSpellingStateAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

An integer value. Defaults to 0, indicating no grammar or spelling error. See "NSSpellingStateAttributeName Flags" for possible values.
This key is available in Mac OS X v10.2 and later, but its interpretation changed in Mac OS X v10.5. Previously, any non-zero value caused the spelling indicator to be displayed. For Mac OS X v10.5 and later, the (integer) value is treated as being composed of the spelling and grammar flags.
Available in Mac OS X v10.5 and later.

NSAttributedStringMBS.NSStrikethroughColorAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSColor
Default nil, same as foreground color
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSStrikethroughStyleAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
// underline selected text in TextArea1

Var t as NSTextViewMBS = TextArea1.NSTextViewMBS
Var s as NSTextStorageMBS = t.textStorage

const NSUnderlineStyleSingle = 1

Var d as Dictionary = t.selectedTextAttributes
d.Value(NSAttributedStringMBS.NSStrikethroughStyleAttributeName) = NSUnderlineStyleSingle
t.selectedTextAttributes = d

Number containing integer
Default 0, no strikethrough. See "Underlining Patterns", "Underlining Styles", and "Underline Masks" in Apple Documentation for mask values.
Available in Mac OS X v10.3 and later.

Some examples using this method:

NSAttributedStringMBS.NSStrokeColorAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSColor
Default nil, same as foreground color
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSStrokeWidthAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
TextArea1.Text = "Hello World!"

Var v As NSTextViewMBS = TextArea1.NSTextViewMBS
Var a As NSTextStorageMBS = v.textStorage

a.addAttribute(a.NSStrokeWidthAttributeName, 2.0, New NSRangeMBS(6,5))

Number containing floating point value, as percent of font point size
Default 0, no stroke; positive, stroke alone; negative, stroke and fill (a typical value for outlined text would be 3.0)
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSSubjectDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing subject of document.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSSuperscriptAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing integer
Default 0

Some examples using this method:

NSAttributedStringMBS.NSTextAlternativesAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 16.0 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names.

An NSTextAlternatives object. Used primarily as a temporary attribute, with primaryString equal to the substring for the range to which it is attached, and alternativeStrings representing alternatives for that string that may be presented to the user.
Available on OS X 10.8 and newer.

NSAttributedStringMBS.NSTextEffectAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 16.0 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names.

NSString, default nil: no text effect

NSAttributedStringMBS.NSTextEffectLetterpressStyle as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 16.0 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the text effect names.

Available on Mac OS X 10.10 or newer.

NSAttributedStringMBS.NSTextEncodingNameDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString related to HTML generation.

An string object containing the name, IANA or otherwise, of a text encoding to be used; mutually exclusive with NSCharacterEncodingDocumentAttribute.
Available in Mac OS X v10.4 and later.

Either NSCharacterEncodingDocumentAttribute or NSTextEncodingNameDocumentAttribute may be used to control the encoding used for generated HTML; character entities are used for characters not representable in the specified encoding.

NSAttributedStringMBS.NSTextEncodingNameDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

string containing the name, IANA or otherwise, of a text encoding to override any encoding specified in an HTML document. Mutually exclusive with @"CharacterEncoding". Previous string constant was @"TextEncodingName".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSTextLayoutSectionOrientation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the constants used as by the NSLayoutOrientationSectionsAttribute.

An Number containing an NSTextLayoutOrientation value. The default value is NSTextLayoutOrientationHorizontal.
Available in Mac OS X v10.7 and later.

NSAttributedStringMBS.NSTextLayoutSectionRange as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the constants used as by the NSLayoutOrientationSectionsAttribute.

An NSValue containing an NSRange representing a character range. The default value is a range covering the entire string.
Available in Mac OS X v10.7 and later.

NSAttributedStringMBS.NSTextLayoutSectionsAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

An Array containing dictionarys. Each dictionary describes a layout orientation section. The dictionary can have two attributes: NSTextLayoutSectionOrientation and NSTextLayoutSectionRange. When there is a gap between sections, it's assumed to have NSTextLayoutOrientationHorizontal.
Available in Mac OS X v10.7 and later.

NSAttributedStringMBS.NSTextSizeMultiplierDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Specifies a scale factor for font sizes.. Number containing float, default 1.0; for HTML only, corresponding to WebView's textSizeMultiplier.
There is no textual equivalent for Mac OS X v10.3.
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSTimeoutDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing float. Time in seconds to wait for a document to finish loading. Previous string constant was @"Timeout".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSTitleDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

string containing document title.
Available in Mac OS X v10.4 and later.

Some examples using this method:

NSAttributedStringMBS.NSToolTipAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

string
Default nil, no tooltip
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSTopMarginDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Number, containing a float, in points.
Mac OS X v10.3 and earlier string constant is "TopMargin".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSUnderlineColorAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

NSColor
Default nil, same as foreground color
Available in Mac OS X v10.3 and later.

NSAttributedStringMBS.NSUnderlineStyleAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

Number containing integer
Default 0, no underline. See "Underlining Patterns", "Underlining Styles", and "Underline Masks" in Apple Documentation for mask values.

NSAttributedStringMBS.NSVerticalGlyphFormAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

An Number containing an integer value, 0 means horizontal text and 1 indicates vertical text. If no value specified, it's interpreted to determine the setting based on higher-level vertical orientation settings such as NSTextLayoutOrientation . The behavior for any other value is undefined.
Available in Mac OS X v10.7 and later.

NSAttributedStringMBS.NSViewModeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

NSValue, containing an int; 0 = normal; 1 = page layout (use value of "PaperSize").
Mac OS X v10.3 and earlier string constant is "ViewMode".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSViewSizeDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

NSValue, containing NSSize.
Mac OS X v10.3 and earlier string constant is "ViewSize".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSViewZoomDocumentAttribute as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the names for document wide attributes in a NSAttributedString.

Mac OS X v10.3 and earlier string constant is "ViewZoom".
NSValue, containing a float; 100 = 100% zoom.
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSWebArchiveTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Web Kit WebArchive document.

NSAttributedStringMBS.NSWebPreferencesDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

WebPreferences; for HTML only, specifies a WebPreferences object. If not present, a default set of preferences is used. Previous string constant was @"WebPreferences".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSWebResourceLoadDelegateDocumentOption as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.

WebResourceLoadDelegateMBS; for HTML only, specifies an object to serve as the web resource loading delegate.
If not present, a default delegate is used that permits the loading of subsidiary resources but does not respond to authentication challenges. Previous string constant was @"WebResourceLoadDelegate".
Available in Mac OS X v10.4 and later.

NSAttributedStringMBS.NSWordMLTextDocumentType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the values for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.

Microsoft Word XML (WordML schema) document.

NSAttributedStringMBS.NSWritingDirectionAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
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

Var t as NSTextStorageMBS = TextArea1.NSTextViewMBS.textStorage

// get hello in arabic
Var a as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithString("مرحبا")
Var 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

An Array of Numbers.
This provides a means to override the default bidi algorithm, equivalent to the use of bidi control characters LRE, RLE, LRO, or RLO paired with PDF, as a higher-level attribute. This is the NSAttributedString equivalent of HTML's dir attribute and/or BDO element. The array represents nested embeddings or overrides, in order from outermost to innermost. The values of the Numbers should be 0, 1, 2, or 3, for LRE, RLE, LRO, or RLO respectively; these should be regarded as NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft plus NSTextWritingDirectionEmbedding or NSTextWritingDirectionOverride.
Available in Mac OS X v10.6 and later.

NSAttributedStringMBS.NSWritingToolsExclusionAttributeName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Text MBS MacBase Plugin 25.0 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the attribute names for NSAttributedString.
Example
var a as new NSMutableAttributedStringMBS
a.setString("Hello World!")

var r as new NSRangeMBS(6,5) // the word "World" above
a.addAttribute(a.NSWritingToolsExclusionAttributeName, true, r)

// check what is at position 7
var d as Dictionary = a.attributesAtIndex(7)

Break // check in debugger

Value is a boolean value. Default is false.
The range of text with NSWritingToolsExclusionAttributeName = true is excluded from the WritingTools processing and preserved.

Currently the text value of the attribute name is "WTWritingToolsPreserved".
Requires macOS 15.2, iOS 18.2 or newer.

Previous items

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


The biggest plugin in space...