Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSAttributedStringMBS class.
NSAttributedStringMBS.initWithRTF(data as memoryblock, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithRTFD(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithRTFD(data as memoryblock, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithString(text as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithString(text as string, withAttributes as Dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithURL(file as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithURL(file as folderitem, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithURL(url as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.initWithURL(url as string, byref documentAttributes as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
documentAttributes: Optional dictionary to receive the attributes.
Returns true on success.
See also:
NSAttributedStringMBS.isEqualToAttributedString(other as NSAttributedStringMBS) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true if they are equal in content.
NSAttributedStringMBS.itemNumberInTextList(list as NSTextListMBS, location as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 18.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
list: The text list.
location: The location of the item.
Returns the index within the list.
NSAttributedStringMBS.lineRangeForRange(range as NSRangeMBS) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 18.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Range: A range within the receiver. The value must not exceed the bounds of the receiver.
The range of characters representing the line or lines containing aRange, including the line termination characters.
NSAttributedStringMBS.mutableCopy as NSMutableAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSAttributedStringMBS.paragraphRangeForRange(range as NSRangeMBS) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 18.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Range: A range within the receiver. The range must not exceed the bounds of the receiver.
The range of characters representing the paragraph or paragraphs containing range, including the paragraph termination characters.
A paragraph is any segment of text delimited by a carriage return (U+000D), newline (U+000A), or paragraph separator (U+2029).
NSAttributedStringMBS.rangeOfTextBlock(textBlock as NSTextBlockMBS, location as Integer) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 22.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSAttributedStringMBS.rangeOfTextList(list as NSTextListMBS, location as Integer) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 18.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
list: The text list.
location: The location in the text list.
Returns the range of the given text list containing the location.
NSAttributedStringMBS.rangeOfTextTable(textTable as NSTextTableMBS, location as Integer) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 22.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSAttributedStringMBS.rtf as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Same as RTFFromRange(0,length)
NSAttributedStringMBS.RTFDFileWrapperFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
offset and length: The range.
documentAttributes: A required dictionary specifying the document attributes. The dictionary contains values from Document Types and must at least contain NSDocumentTypeDocumentAttribute. If there are no document-level attributes, dict can be nil.
Returns a file wrapper containing the RTFD data.
The file wrapper also includes the document-level attributes in docAttributes, as explained in RTF Files and Attributed Strings.
Raises an NSRangeException if any part of aRange lies beyond the end of the receiver’s characters.
You can save the file wrapper using the NSFileWrapper method writeToFile.
NSAttributedStringMBS.RTFDFromRange(documentAttributes as dictionary = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
Same as RTFDFromRange(0,length)
documentAttributes can optionally be a dictionary with document attributes like author or title.
See also:
NSAttributedStringMBS.RTFDFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
documentAttributes can optionally be a dictionary with document attributes like author or title.
See also:
NSAttributedStringMBS.RTFFromRange(documentAttributes as dictionary = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
Same as RTFFromRange(0,length)
documentAttributes can optionally be a dictionary with document attributes like author or title.
See also:
NSAttributedStringMBS.RTFFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
documentAttributes can optionally be a dictionary with document attributes like author or title.
See also:
NSAttributedStringMBS.size as NSSizeMBS New in 24.4
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Text | MBS MacBase Plugin | 24.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The minimum size required to draw the entire contents of the string.
Discussion
You can use this method prior to drawing to compute how much space is required to draw the string.
This method may return fractional sizes. When setting the size of your view, use the ceil function to round fractional values up to the nearest whole number.
The items on this page are in the following plugins: MBS MacBase Plugin.