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

FamilyName

Gets the family name for the typeface.

FontSlant

Gets the font slant 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)
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.

UnitsPerEm

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

Methods

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

Given a buffer containing character codes, of the specified encoding, optionally return their corresponding glyph IDs.

CharsToGlyphs(String, UInt16[])

Given a string, optionally return their corresponding glyph IDs.

CountGlyphs(IntPtr, Int32, SKEncoding)

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

CountGlyphs(String)

Returns the number of glyphs on the string.

Dispose() Inherited from SKNativeObject
Dispose(Boolean)
FromData(SKData, Int32)

Returns a new typeface given data.

FromFamilyName(String, Int32, Int32, SKFontStyleSlant)

Return 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

GetTableData(UInt32)

Returns the contents of the table 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.

Applies to