SkiaSharp.SKTypeface Class

Represents a specific typeface and intrinsic style of a font.

See Also: SKTypeface

Syntax

public class SKTypeface : SKObject

Remarks

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

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

Requirements

Namespace: SkiaSharp
Assembly: SkiaSharp (in SkiaSharp.dll)
Assembly Versions: 1.0.0.0, 1.49.0.0, 1.52.0.0, 1.53.0.0, 1.54.0.0, 1.54.0.0, 1.55.0.0, 1.56.0.0, 1.57.0.0, 1.58.0.0, 1.59.0.0

The members of SkiaSharp.SKTypeface are listed below.

See Also: SKObject

Public Properties

[read-only]
FamilyNameString. Gets the family name for the typeface.
[read-only]
FontSlantSKFontStyleSlant. Gets the font slant for the typeface.
[read-only]
FontWeightInt32. Gets the font weight for the typeface.
[read-only]
FontWidthInt32. Gets the font width for the typeface.
[read-only]
StyleSKTypefaceStyle. Gets the the typeface's intrinsic style attributes.
[read-only]
UnitsPerEmInt32. Gets the units-per-em value for this typeface, or zero if there is an error.

Public Methods

CharsToGlyphs(String, out UInt16[]) : Int32
Given a string, optionally return their corresponding glyph IDs.
CharsToGlyphs(IntPtr, Int32, SKEncoding, out UInt16[]) : Int32
Given a buffer containing character codes, of the specified encoding, optionally return their corresponding glyph IDs.
CountGlyphs(String) : Int32
Returns the number of glyphs on the string.
CountGlyphs(IntPtr, Int32, SKEncoding) : Int32
Returns the number of glyphs on the specified buffer with the specified length and encoding.
static
FromFamilyName(String, SKTypefaceStyle) : SKTypeface
Returns a new instance to a typeface that most closely matches the requested family name and style.
static
FromFamilyName(String, SKFontStyleWeight, SKFontStyleWidth, SKFontStyleSlant) : SKTypeface
Return a new instance to a typeface that most closely matches the requested family name and style.
static
FromFamilyName(String, Int32, Int32, SKFontStyleSlant) : SKTypeface
Return a new instance to a typeface that most closely matches the requested family name and style.
static
FromFile(String, Int32) : SKTypeface
Returns a new typeface given a file. 
static
FromStream(SKStreamAsset, Int32) : SKTypeface
Returns a new typeface given a stream. Ownership of the stream is transferred, so the caller must not reference it again.
static
FromStream(Stream, Int32) : SKTypeface
Returns a new typeface given a stream. Ownership of the stream is transferred, so the caller must not reference it again.
static
FromTypeface(SKTypeface, SKTypefaceStyle) : SKTypeface
Return a new reference to the typeface that most closely matches the requested typeface and specified style
GetTableData(UInt32) : Byte[]
Returns the contents of the table data for the specified tag.
GetTableTags() : UInt32[]
Returns the list of table tags in the font.
OpenStream() : SKStreamAsset
Returns a stream for the contents of the font data.
OpenStream(out Int32) : SKStreamAsset
Returns a stream for the contents of the font data.
TryGetTableData(UInt32, out Byte[]) : Boolean
Returns the contents of the table data for the specified tag.

Protected Methods

override
Dispose(Boolean)