Platforms to show: All Mac Windows Linux Cross-Platform
Back to CFAttributedStringMBS class.
CFAttributedStringMBS.AsNSAttributedString as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For passing to functions which need a NSAttributedStringMBS.
CFAttributedStringMBS.AttributeAndLongestEffectiveRange(location as Integer, attrName as CFStringMBS, inRange as CFRangeMBS, byref effectiveRange as CFRangeMBS) as CFObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The location in str at which to determine the attributes. It is a programming error for loc to specify a location outside the bounds of str.
attrName: The name of the attribute whose value you want to determine.
inRange: The range in str within which you want to find the longest effective range of the attributes at loc. inRange must not exceed the bounds of str.
effectiveRange: upon return contains the maximal range within inRange over which the exact same set of attributes apply. The returned range is clipped to inRange.
Returns the attribute value of str at the specified location.
CFAttributedStringMBS.AttributesAndLongestEffectiveRange(location as Integer, inRange as CFRangeMBS, byref effectiveRange as CFRangeMBS) as CFDictionaryMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
inRange: The range in str within to find the longest effective range of the attributes at loc. inRange must not exceed the bounds of str.
effectiveRange: upon return contains the maximal range within inRange over which the exact same set of attributes apply. The returned range is clipped to inRange.
CFAttributedStringMBS.AttributesDictionary(location as Integer, byref effectiveRange as CFRangeMBS) as CFDictionaryMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
effectiveRange: upon return contains a range including loc over which exactly the same set of attributes apply as at loc.
Returns a dictionary that contains the attributes of str at the specified location. Ownership follows the Get Rule.
For performance reasons, a range returned in effectiveRange is not necessarily the maximal range. If you need the maximum range, you should use AttributesAndLongestEffectiveRange.
Note that the returned attribute dictionary might change in unpredictable ways if the attributed string is edited after this call. If you want to preserve the state of the dictionary, you should make an actual copy of it rather than just retaining it. In addition, you should make no assumptions about the relationship of the actual dictionary returned by this call and the dictionary originally used to set the attributes, other than the fact that the values stored in the dictionaries will be identical (that is, ==) to those originally specified.
CFAttributedStringMBS.AttributeValue(location as Integer, attrName as CFStringMBS, byref effectiveRange as CFRangeMBS) as CFObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
attrName: The name of the attribute whose value you want to determine.
effectiveRange: upon return contains a range including loc over which exactly the same set of attributes apply as at location.
Returns the value of the specified attribute at the specified location in str. Ownership follows the Get Rule.
For performance reasons, a range returned in effectiveRange is not necessarily the maximal range. If you need the maximum range, you should use AttributeAndLongestEffectiveRange.
CFAttributedStringMBS.Constructor(str as CFAttributedStringMBS, range as CFRangeMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
str: The attributed string to copy.
range: The range of the attributed string to copy. range must not exceed the bounds of Str.
Returns a new attributed string whose string and attributes are copied from the specified range of the supplied attributed string. Raises OutOfMemory exception if there was a problem copying the object. Ownership follows the Create Rule.
See also:
CFAttributedStringMBS.Constructor(str as CFStringMBS, attributeDictionary as CFDictionaryMBS = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
str: A string that specifies the characters to use in the new attributed string. This value is copied.
attributeDictionary: A dictionary that contains the attributes to apply to the new attributed string. This value is copied.
Returns an attributed string that contains the characters from str and the attributes specified by attributes. Raises OutOfMemory exception if there was a problem in creating the attributed string.
Note that both the string and the attributes dictionary are copied. The specified attributes are applied to the whole string. If you want to apply different attributes to different ranges of the string, you should use a mutable attributed string.
See also:
CFAttributedStringMBS.Copy as CFAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CFAttributedStringMBS.GetLength as Integer Deprecated
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Deprecated in favor of Length property.
CFAttributedStringMBS.GetString as CFStringMBS Deprecated
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Deprecated in favor of String function.
CFAttributedStringMBS.MutableCopy(maxLength as Integer = 0) as CFAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
maxLength, if not 0, is a hard bound on the length of the attributed string; exceeding this size limit during any editing operation is a programming error. If 0, there is no limit on the length.
CFAttributedStringMBS.String as CFStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For performance reasons, the string returned will often be the backing store of the attributed string, and it might therefore change if the attributed string is edited. However, this is an implementation detail, and you should not rely on this behavior.
The items on this page are in the following plugins: MBS MacCF Plugin.