Platforms to show: All Mac Windows Linux Cross-Platform

Back to CTFontMBS class.

CTFontMBS.Available as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Whether this class is available.

Returns true in OS X v10.5 and later.

CTFontMBS.CreateUIFontForLanguage(Type as Integer, size as Double = 0.0, language as string = "") as CTFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the special user-interface font for the given language and user-interface type.

Type: A constant specifying the intended user-interface use for the requested font reference. See Enumerations for possible values.
size: The point size for the font reference. If 0.0 is specified, the default size for the requested user-interface type is used.
language: Language specifier string to select a font for a particular localization. If "" is specified, the current system language is used. The format of the language identifier should conform to the RFC 3066bis standard.

Returns the correct font for various user-interface uses.
The only required parameter is the Type selector; the other parameters have default values.

Some examples using this method:

CTFontMBS.CreateWithFontDescriptor(descriptor as CTFontDescriptorMBS, size as Double = 0.0, matrix as CGAffineTransformMBS = nil, options as Integer = 0) as CTFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a new font reference that best matches the given font descriptor.

descriptor: A font descriptor containing attributes that specify the requested font.
size: The point size for the font reference. If 0.0 is specified, the default font size of 12.0 is used. This parameter is optional.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil is specified, the identity matrix is used. This parameter is optional.

Returns a CTFontMBS that best matches the attributes provided with the font descriptor.

The size and matrix parameters override any specified in the font descriptor unless they are unspecified (0.0 for size and NULL for matrix). A best match font is always returned, and default values are used for any unspecified parameters.

CTFontMBS.CreateWithGraphicsFont(graphicsFont as CGFontMBS, size as Double = 0.0, matrix as CGAffineTransformMBS = nil, attributeValues as CTFontDescriptorMBS = nil) as CTFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new font reference from an existing Core Graphics font reference.

graphicsFont: A valid Core Graphics font reference.
size: The point size for the font reference. If 0.0 is specified the default font size of 12.0 is used.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil, the identity matrix is used. Optional.
attributes: Additional attributes that should be matched. Optional.

Returns a new font reference for an existing CGFontRef object with the specified size, matrix, and additional attributes.

CTFontMBS.CreateWithName(name as string, size as Double = 0.0, matrix as CGAffineTransformMBS = nil, options as Integer = 0) as CTFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a new font reference for the given name.
Example
Var c as CTFontMBS = CTFontMBS.CreateWithName("Times", 12)
MsgBox c.FullName

name: The font name for which you wish to create a new font reference. A valid PostScript name is preferred, although other font name types are matched in a fallback manner.
size: The point size for the font reference. If 0.0 is specified, the default font size of 12.0 is used. This parameter is optional.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil is specified, the identity matrix is used. This parameter is optional.

Returns a CTFontRef that best matches the name provided with size and matrix attributes.

The name parameter is the only required parameter, and default values are used for unspecified parameters (0.0 for size and nil for matrix). If all parameters cannot be matched identically, a best match is found.

CTFontMBS.CreateWithPlatformFont(ATSFontHandle as Integer, size as Double = 0.0, matrix as CGAffineTransformMBS = nil, attributeValues as CTFontDescriptorMBS = nil) as CTFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a new font reference from an ATS font reference.

ATSFontHandle: A valid ATSFontRef object.
size: The point size for the font reference. If 0.0 is specified the default font size of 12.0 is used.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil, the identity matrix is used. Optional.
attributes: A CTFontDescriptorMBS containing additional attributes that should be matched. Optional.

Returns a new font reference for an ATSFontRef with the specified size, matrix, and additional attributes.

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


The biggest plugin in space...