Platforms to show: All Mac Windows Linux Cross-Platform
CGFontMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | CoreGraphics | MBS MacCG Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The CGFontRef opaque type encapsulates font information. A font is a set of shapes or glyphs associated with a character set. A glyph can represent a single character (such as ‘b’), more than one character (such as the "fi" ligature), or a special character such as a space. Quartz retrieves the glyphs for the font from ATS (Apple Type Services) and paints the glyphs based on the relevant parameters of the current graphics state.
Quartz provides a limited, low-level interface for drawing text. For information on text-drawing functions, see CGContext Reference. For full Unicode and text-layout support, use the services provided by Core Text or ATSUI).
- 13 properties
- property Ascent as Integer
- property CapHeight as Integer
- property Descent as Integer
- property FontBBox as CGRectMBS
- property FullName as String
- property Handle as Integer
- property ItalicAngle as Double
- property Leading as Integer
- property NumberOfGlyphs as UInt64
- property PostScriptName as String
- property StemV as Double
- property UnitsPerEm as Integer
- property XHeight as Integer
- 3 shared methods
- shared method CreateWithDataProvider(CGDataProvider as Variant) as CGFontMBS
- shared method CreateWithFontName(name as string) as CGFontMBS
- shared method CreateWithPlatformFont(ATSFontHandle as Integer) as CGFontMBS
- 6 constants
Constants
Constant | Value | Description |
---|---|---|
kCGFontIndexInvalid | 65535 | An invalid font index (a value which never represents a valid glyph). |
kCGFontIndexMax | 65534 | The maximum allowed value for font index. |
kCGGlyphMax | 65534 | The maximum value for a glyph. |
PostScript Formats
Constant | Value | Description |
---|---|---|
kCGFontPostScriptFormatType1 | 1 |
This is documented in Adobe Type 1 Font Format, which is available from http://partners.adobe.com/. |
kCGFontPostScriptFormatType3 | 3 |
This is documented in PostScript Language Reference, 3rd edition, which is available from http://partners.adobe.com/. |
kCGFontPostScriptFormatType42 | 42 |
This is documented in Adobe Technical Note 5012, The Type 42 Font Format Specification, which is available from http://partners.adobe.com/. |
This class has no sub classes.
Some methods using this class:
- CGContextMBS.SetFont(font as CGFontMBS)
- CoreTextMBS.RegisterGraphicsFont(font as CGFontMBS, byref error as CFErrorMBS) as boolean
- CoreTextMBS.UnregisterGraphicsFont(font as CGFontMBS, byref error as CFErrorMBS) as boolean
- CTFontMBS.CreateWithGraphicsFont(graphicsFont as CGFontMBS, size as Double = 0.0, matrix as CGAffineTransformMBS = nil, attributeValues as CTFontDescriptorMBS = nil) as CTFontMBS
- CTFontMBS.GraphicsFont(byref fontAttributes as CTFontDescriptorMBS) as CGFontMBS
Blog Entries
- MBS Xojo Plugins, version 22.5pr1
- MBS Xojo / Real Studio plug-ins in version 14.2
- MBS Xojo / Real Studio Plugins, version 14.2pr7
Xojo Developer Magazine
Release notes
- Version 22.5
- Deprecated CreateWithPlatformFont function in CGFontMBS class.
The items on this page are in the following plugins: MBS MacCG Plugin.