Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGFontMBS class.

CGFontMBS.CreateWithDataProvider(CGDataProvider as Variant) as CGFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a font object from data supplied from a data provider.

Dataprovider must be a CGDataProviderMBS object.
Returns the font object or nil if the font can't be created.

Before drawing text in a Quartz context, you must set the font in the current graphics state by calling the function CGContextMBS.SetFontSize.

CGFontMBS.CreateWithFontName(name as string) as CGFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a font object corresponding to the font specified by a PostScript or full name.
Example
dim c as CGFontMBS = CGFontMBS.CreateWithFontName("Courier")
MsgBox c.FullName

Returns the font object or nil if the font can't be created.
Before drawing text in a Quartz context, you must set the font in the current graphics state by calling the function CGContextMBS.SetFont.

CGFontMBS.CreateWithPlatformFont(ATSFontHandle as Integer) as CGFontMBS

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

Create a CGFont using platformFontReference, a handle to a platform-specific font reference.
For MacOS X, platformFontReference should be a handle to an ATSFontRef.

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


The biggest plugin in space...