SKTypeface Class

Definition

Represents a specific typeface and intrinsic style of a font.

public class SKTypeface : SkiaSharp.SKObject
Inheritance

Remarks

This is used in the paint, along with optionally algorithmic settings like SKPaint.TextSize, SKPaint.TextSkewX, SKPaint.TextScaleX, and SKPaint.FakeBoldText to specify how text appears when drawn (and measured).

Typeface objects are immutable, and so they can be shared between threads.

Properties

Default

Gets the default, Normal typeface.

FamilyName

Gets the family name for the typeface.

FontSlant

Gets the font slant for the typeface.

FontStyle

Gets the font style for the typeface.

FontWeight

Gets the font weight for the typeface.

FontWidth

Gets the font width for the typeface.

Handle

Gets or sets the handle to the underlying native object.

(Inherited from SKObject)
IgnorePublicDispose

Gets or sets a value indicating whether the call the public Dispose() should be no-op.

(Inherited from SKNativeObject)
IsDisposed

Gets or sets a value indicating whether the object has already been disposed.

(Inherited from SKNativeObject)
OwnsHandle

Gets a value indicating whether this object should destroy the underlying native object.

(Inherited from SKObject)
Style

Gets the the typeface's intrinsic style attributes.

TableCount

Gets the number of data tables in the typeface.

UnitsPerEm

Gets the units-per-em value for this typeface, or zero if there is an error.

Methods

CharsToGlyphs(IntPtr, Int32, SKEncoding, UInt16[])

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

CharsToGlyphs(String, UInt16[])

Retrieve the corresponding glyph IDs of a string of characters.

CountGlyphs(Byte[], SKEncoding)

Returns the number of glyphs in the buffer.

CountGlyphs(IntPtr, Int32, SKEncoding)

Returns the number of glyphs on the specified buffer with the specified length and encoding.

CountGlyphs(ReadOnlySpan<Byte>, SKEncoding)

Returns the number of glyphs in the buffer.

CountGlyphs(String)

Returns the number of glyphs in the string.

CountGlyphs(String, SKEncoding)

Returns the number of glyphs on the string.

CreateDefault()

Creates a new SKTypeface which is the default, Normal typeface.

Dispose()

Releases all resources used by this SKNativeObject.

(Inherited from SKNativeObject)
Dispose(Boolean)

Releases the unmanaged resources used by the SKTypeface and optionally releases the managed resources.

DisposeInternal()

Triggers a dispose, ignoring the value of IgnorePublicDispose.

(Inherited from SKNativeObject)
DisposeManaged()

Implemented by derived SKObject types to destroy any managed objects.

(Inherited from SKObject)
DisposeNative()

Implemented by derived SKObject types to destroy any native objects.

(Inherited from SKObject)
FromData(SKData, Int32)

Returns a new typeface given data.

FromFamilyName(String)

Returns a new instance to a typeface that most closely matches the requested family name and style.

FromFamilyName(String, Int32, Int32, SKFontStyleSlant)

Return a new instance to a typeface that most closely matches the requested family name and style.

FromFamilyName(String, SKFontStyle)

Returns a new instance to a typeface that most closely matches the requested family name and style.

FromFamilyName(String, SKFontStyleWeight, SKFontStyleWidth, SKFontStyleSlant)

Return a new instance to a typeface that most closely matches the requested family name and style.

FromFamilyName(String, SKTypefaceStyle)

Returns a new instance to a typeface that most closely matches the requested family name and style.

FromFile(String, Int32)

Returns a new typeface given a file.

FromStream(SKStreamAsset, Int32)

Returns a new typeface given a stream. Ownership of the stream is transferred, so the caller must not reference it again.

FromStream(Stream, Int32)

Returns a new typeface given a stream. Ownership of the stream is transferred, so the caller must not reference it again.

FromTypeface(SKTypeface, SKTypefaceStyle)

Return a new reference to the typeface that most closely matches the requested typeface and specified style

GetGlyphs(Byte[], SKEncoding)

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

GetGlyphs(Byte[], SKEncoding, UInt16[])

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

GetGlyphs(IntPtr, Int32, SKEncoding)

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

GetGlyphs(IntPtr, Int32, SKEncoding, UInt16[])

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

GetGlyphs(ReadOnlySpan<Byte>, SKEncoding)

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

GetGlyphs(ReadOnlySpan<Byte>, SKEncoding, UInt16[])

Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding.

GetGlyphs(String)

Retrieve the corresponding glyph IDs of a string of characters.

GetGlyphs(String, SKEncoding)

Retrieve the corresponding glyph IDs of a string of characters, of the specified encoding.

GetGlyphs(String, SKEncoding, UInt16[])

Retrieve the corresponding glyph IDs of a string of characters.

GetGlyphs(String, UInt16[])

Retrieve the corresponding glyph IDs of a string of characters.

GetTableData(UInt32)

Returns the contents of the table data for the specified tag.

GetTableSize(UInt32)

Returns the size of the data for the specified tag.

GetTableTags()

Returns the list of table tags in the font.

OpenStream()

Returns a stream for the contents of the font data.

OpenStream(Int32)

Returns a stream for the contents of the font data.

TryGetTableData(UInt32, Byte[])

Returns the contents of the table data for the specified tag.

TryGetTableData(UInt32, Int32, Int32, IntPtr)

Returns the contents of the table data for the specified tag.

TryGetTableTags(UInt32[])

Returns the list of table tags in the font.

Applies to