Platforms to show: All Mac Windows Linux Cross-Platform
Back to CoreTextMBS class.
CoreTextMBS.AutoActivationSetting(BundleID as string) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
bundleID: The bundle identifier used to specify a particular application bundle. If "", the current application bundle is used. If kCTFontManagerBundleIdentifier is specified, sets global auto-activation.
(Read and Write computed property)
CoreTextMBS.AvailableFontFamilyNames as string()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Some examples using this method:
CoreTextMBS.AvailableFontURLs as string()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
CoreTextMBS.AvailablePostScriptNames as string()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Some examples using this method:
CoreTextMBS.CompareFontFamilyNames(name1 as string, name2 as string) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
family1: The first localized font family name to compare, as a string.
family2: The second localized font family name to compare, as a string.
Returns a CFComparisonResult value indicating the sort order for the two family names. kCFComparisonResultGreatherThan (1) if family1 is greater than family2, kCFComparisonResultLessThan (-1) if family1 is less than family2, and kCFComparisonResultEqualTo (0) if they are equal.
This CFComparatorFunction function compares font family names and sorts them in the Apple preferred order, accounting for foundry prefix. Family names with recognized prefixes are sorted after the unprefixed names in prefix order.
CoreTextMBS.CoreTextVersion as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This function returns a number indicating the version of the CoreText framework. Note that framework version is not always an accurate indicator of feature availability. The recommended way to use this function is first to check that the function pointer is non nil (plugin will do and raise exceptions), followed by calling it and comparing its result to a defined constant (or constants).
Returns the version number. This value is for comparison with the constants beginning with kCTVersionNumber.
CoreTextMBS.CreateFontDescriptorFromData(data as memoryblock) as CTFontDescriptorMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Note: the font descriptor is not available through font descriptor matching.
data: A memoryblock containing font data.
Returns a font descriptor created from the data, or nil on error.
See also:
CoreTextMBS.CreateFontDescriptorFromData(data as string) as CTFontDescriptorMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Note: the font descriptor is not available through font descriptor matching.
data: A string containing font data.
Returns a font descriptor created from the data, or nil on error.
See also:
CoreTextMBS.CreateFontDescriptorsFromFile(file as folderitem) as CTFontDescriptorMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
file: A folderitem referencing a valid font file.
CoreTextMBS.CreateFontDescriptorsFromURL(URL as string) as CTFontDescriptorMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
URL: A file system URL referencing a valid font file.
CoreTextMBS.EnableFontDescriptors(descriptors() as CTFontDescriptorMBS, enable as boolean)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
descriptors: Array of font descriptors.
enable: Boolean value indicating whether the fonts matching descriptors should be enabled for font descriptor matching.
CoreTextMBS.GetScopeForFile(file as folderitem) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The registration scope of the specified file or kCTFontManagerScopeNone if not currently registered.
Available in OS X v10.6 and later.
CoreTextMBS.GetScopeForURL(URL as string) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The registration scope of the specified URL or kCTFontManagerScopeNone if not currently registered.
Available in OS X v10.6 and later.
CoreTextMBS.IsSupportedFontFile(file as folderitem) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns true if the folderitem refers to a valid font that can be used on the current platform; false otherwise.
CoreTextMBS.IsSupportedFontURL(URL as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns true if the URL refers to a valid font that can be used on the current platform; false otherwise.
CoreTextMBS.MatchFontDescriptorsWithProgressHandler(descriptors() as CTFontDescriptorMBS, mandatoryAttributes() as string, tag as Variant = nil) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This function returns immediately, but can potentially take long time to process. The progress is notified via progress evnet.
descriptors: An array of descriptors to process.
mandatoryAttributes: some mandatory attributes.
Returns false if it couldn't start the work.
CoreTextMBS.RegisterFontsForFile(file as folderitem, scope as Integer, byref error as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
fontURL: The font URL.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
error: a CFErrorMBS object which, in case of failed registration, contains error information.
Returns true if registration of the fonts was successful, otherwise false.
CoreTextMBS.RegisterFontsForFiles(files() as folderitem, scope as Integer, errors() as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
files: Array of font files.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
errors: An array of CFErrorMBS objects which, in case of failed registration, contain error information. Each error contains a CFArrayMBS of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error and were not successfully registered. The array must be released by the caller. Can be nil.
Returns true if registration of all font URLs was successful, otherwise false.
CoreTextMBS.RegisterFontsForURL(URL as string, scope as Integer, byref error as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
fontURL: The font URL.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
error: a CFErrorMBS object which, in case of failed registration, contains error information.
Returns true if registration of the fonts was successful, otherwise false.
See also:
CoreTextMBS.RegisterFontsForURL(URLs() as string, scope as Integer, errors() as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
URLs: Array of font URLs.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
errors: Array of CFErrorMBS objects which, in case of failed registration, contain error information. Each error contains a CFArrayMBS of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error and were not successfully registered. The array must be released by the caller. Can be nil.
Please pass in errors array empty as
Returns true if registration of all font URLs was successful, otherwise false.
See also:
CoreTextMBS.RegisterGraphicsFont(font as CGFontMBS, byref error as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
font: The graphics font to be registered.
error: Returns by indirection an error object in the case of failed registration.
Returns true if registration of the font was successful, otherwise false.
Registered fonts are discoverable through font descriptor matching. Any attempt to register a font that is either already registered or contains the same Postscript of an already registered font will fail. This behavior is useful for fonts that may be embedded in documents or constructed in memory. A graphics font is obtained by calling CGFontMBS.CreateWithDataProvider. Fonts that are backed by files should be registered using CoreTextMBS.RegisterFontsForURL.
CoreTextMBS.UnregisterFontsForFile(file as folderitem, scope as Integer, byref error as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
URL: The font URL.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
error: A CFError object which, in case of failed registration, contains error information.
Returns true if unregistration of the fonts was successful, otherwise false.
CoreTextMBS.UnregisterFontsForFiles(files() as folderitem, scope as Integer, errors() as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
files: Array of font folderitems.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
errors: An array of CFError objects which, in case of failed registration, contain error information. Each error contains a CFArray of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error and were not successfully registered. The array must be released by the caller.
Returns true if unregistration of all font URLs was successful, otherwise false.
CoreTextMBS.UnregisterFontsForURL(URL as string, scope as Integer, byref error as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
URL: The font URL.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
error: A CFError object which, in case of failed registration, contains error information.
Returns true if unregistration of the fonts was successful, otherwise false.
CoreTextMBS.UnregisterFontsForURLs(URLs() as string, scope as Integer, errors() as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
URLs: Array of font URLs.
scope: Scope constant defining the availability and lifetime of the registration. See "Font Registration Scope" for values to pass for this parameter.
errors: An array of CFError objects which, in case of failed registration, contain error information. Each error contains a CFArray of font URLs corresponding to kCTFontManagerErrorFontURLsKey. These URLs represent the font files that caused the error and were not successfully registered. The array must be released by the caller.
Returns true if unregistration of all font URLs was successful, otherwise false.
CoreTextMBS.UnregisterGraphicsFont(font as CGFontMBS, byref error as CFErrorMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | CoreText | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
font: The graphics font to be unregistered.
error: Returns by indirection an error object in the case of failed unregistration.
Returns true if unregistration of the font was successful, otherwise false.
Unregistered fonts are no longer discoverable through font descriptor matching. Fonts that are backed by files should be unregistered using CTFontManagerUnregisterFontsForURL.
The items on this page are in the following plugins: MBS MacCG Plugin.