Share via


CTFont Class

Definition

Represents a CoreText Font.

public class CTFont : CoreFoundation.NativeObject
type CTFont = class
    inherit NativeObject
Inheritance

Remarks

CoreText does not synthesize font styles (italic and bold). This means that if you pick a font that has neither a Bolded or Italicized versions available, CoreText will not create a dynamic font that is merely a slanted version of the font for italic, or a boldened version from the original font. In those cases, if you want to synthesize the font, you could apply a Matrix transformation to slant the font (it will still be wrong, but will look slanted). For bolding, you could stroke the font twice, or manually extend the glyph path.

Constructors

Name Description
CTFont(CGFont, NFloat, CGAffineTransform, CTFontDescriptor)
CTFont(CGFont, NFloat, CGAffineTransform)
CTFont(CGFont, NFloat, CTFontDescriptor)
CTFont(CTFontDescriptor, NFloat, CGAffineTransform)
CTFont(CTFontDescriptor, NFloat, CTFontOptions, CGAffineTransform)
CTFont(CTFontDescriptor, NFloat, CTFontOptions)
CTFont(CTFontDescriptor, NFloat)
CTFont(CTFontUIFontType, NFloat, String)
CTFont(String, NFloat, CGAffineTransform, CTFontOptions)
CTFont(String, NFloat, CGAffineTransform)
CTFont(String, NFloat, CTFontOptions)
CTFont(String, NFloat)

Properties

Name Description
AscentMetric
BoundingBox
CapHeightMetric
CharacterSet
DescentMetric
DisplayName
FamilyName
FullName
GlyphCount
Handle (Inherited from DisposableObject)
LeadingMetric
Matrix

The transformation matrix used when this font was created.

Owns (Inherited from DisposableObject)
PostScriptName
Size

The font size.

SlantAngle
StringEncoding
SymbolicTraits
UnderlinePosition
UnderlineThickness
UnitsPerEmMetric
XHeightMetric

Methods

Name Description
ClearHandle() (Inherited from DisposableObject)
Dispose() (Inherited from DisposableObject)
Dispose(Boolean) (Inherited from NativeObject)
DrawGlyphs(CGContext, UInt16[], CGPoint[])
DrawImage(ICTAdaptiveImageProviding, CGPoint, CGContext)

Draws the image for an adaptive image glyph at the given point.

Equals(Object) (Inherited from DisposableObject)
ForString(String, NSRange, String)
ForString(String, NSRange)
GetAdvancesForGlyphs(CTFontOrientation, UInt16[], CGSize[], IntPtr)
GetAdvancesForGlyphs(CTFontOrientation, UInt16[])
GetAttribute(NSString)
GetAvailableTables(CTFontTableOptions)
GetBoundingRects(CTFontOrientation, UInt16[], CGRect[], IntPtr)
GetBoundingRects(CTFontOrientation, UInt16[])
GetCheckedHandle() (Inherited from DisposableObject)
GetDefaultCascadeList(String[])
GetFeatures()
GetFeatureSettings()
GetFontDescriptor()
GetFontTableData(CTFontTable, CTFontTableOptions)
GetGlyphName(UInt16)
GetGlyphsForCharacters(Char[], UInt16[], IntPtr)
GetGlyphsForCharacters(Char[], UInt16[])
GetGlyphWithName(String)
GetHashCode() (Inherited from DisposableObject)
GetLigatureCaretPositions(UInt16, NFloat[])
GetLocalizedName(CTFontNameKey, String)
GetLocalizedName(CTFontNameKey)
GetName(CTFontNameKey)
GetOpticalBounds(UInt16[], CGRect[], IntPtr, CTFontOptions)
GetPathForGlyph(UInt16, CGAffineTransform)
GetPathForGlyph(UInt16)
GetSupportedLanguages()
GetTraits()
GetTypeID()

Type identifier for the CoreText.CTFont type.

GetTypographicBoundsForAdaptiveImageProvider(ICTAdaptiveImageProviding)

Computes metrics that clients performing their own typesetting of an adaptive image glyph need.

GetVariation()
GetVariationAxes()
GetVerticalTranslationsForGlyphs(UInt16[], CGSize[], IntPtr)
HasTable(CTFontTable)

Checks whether a table is present in a font.

InitializeHandle(NativeHandle) (Inherited from DisposableObject)
Release() (Inherited from NativeObject)
Retain() (Inherited from NativeObject)
ToCGFont()
ToCGFont(CTFontDescriptor)
ToString()
WithAttributes(NFloat, CTFontDescriptor, CGAffineTransform)
WithAttributes(NFloat, CTFontDescriptor)
WithFamily(NFloat, String, CGAffineTransform)
WithFamily(NFloat, String)
WithSymbolicTraits(NFloat, CTFontSymbolicTraits, CTFontSymbolicTraits, CGAffineTransform)
WithSymbolicTraits(NFloat, CTFontSymbolicTraits, CTFontSymbolicTraits)

Extension Methods

Name Description
GetHandle(INativeObject)
GetNonNullHandle(INativeObject, String)

Applies to

See also