SKTypeface Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
GlyphCount | |
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) |
IsBold |
Gets a value indicating whether the typeface claims to be a bold typeface. |
IsDisposed |
Gets or sets a value indicating whether the object has already been disposed. (Inherited from SKNativeObject) |
IsFixedPitch |
Gets a value indicating whether the typeface claims to be fixed-pitch. |
IsItalic |
Gets a value indicating whether the typeface claims to be slanted. |
OwnsHandle |
Gets a value indicating whether this object should destroy the underlying native object. (Inherited from SKObject) |
Style |
Obsolete.
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[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
CharsToGlyphs(String, UInt16[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a string of characters. |
ContainsGlyph(Int32) | |
ContainsGlyphs(IntPtr, Int32, SKTextEncoding) | |
ContainsGlyphs(ReadOnlySpan<Byte>, SKTextEncoding) | |
ContainsGlyphs(ReadOnlySpan<Char>) | |
ContainsGlyphs(ReadOnlySpan<Int32>) | |
ContainsGlyphs(String) | |
CountGlyphs(Byte[], SKEncoding) |
Obsolete.
Returns the number of glyphs in the buffer. |
CountGlyphs(Byte[], SKTextEncoding) | |
CountGlyphs(IntPtr, Int32, SKEncoding) |
Obsolete.
Obsolete.
Returns the number of glyphs on the specified buffer with the specified length and encoding. |
CountGlyphs(IntPtr, Int32, SKTextEncoding) | |
CountGlyphs(ReadOnlySpan<Byte>, SKEncoding) |
Obsolete.
Returns the number of glyphs in the buffer. |
CountGlyphs(ReadOnlySpan<Byte>, SKTextEncoding) | |
CountGlyphs(ReadOnlySpan<Char>) | |
CountGlyphs(String, SKEncoding) |
Obsolete.
Returns the number of glyphs on the string. |
CountGlyphs(String) |
Returns the number of glyphs in 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) |
DisposeUnownedManaged() | (Inherited from SKObject) |
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, 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) |
Obsolete.
Returns a new instance to a typeface that most closely matches the requested family name and style. |
FromFamilyName(String) |
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) |
Obsolete.
Return a new reference to the typeface that most closely matches the requested typeface and specified style |
GetGlyph(Int32) | |
GetGlyphs(Byte[], SKEncoding, UInt16[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
GetGlyphs(Byte[], SKEncoding) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
GetGlyphs(IntPtr, Int32, SKEncoding, UInt16[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
GetGlyphs(IntPtr, Int32, SKEncoding) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
GetGlyphs(IntPtr, Int32, SKTextEncoding) | |
GetGlyphs(ReadOnlySpan<Byte>, SKEncoding, UInt16[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
GetGlyphs(ReadOnlySpan<Byte>, SKEncoding) |
Obsolete.
Retrieve the corresponding glyph IDs of a buffer containing character codes, of the specified encoding. |
GetGlyphs(ReadOnlySpan<Byte>, SKTextEncoding) | |
GetGlyphs(ReadOnlySpan<Char>) | |
GetGlyphs(ReadOnlySpan<Int32>) | |
GetGlyphs(String, SKEncoding, UInt16[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a string of characters. |
GetGlyphs(String, SKEncoding) |
Obsolete.
Retrieve the corresponding glyph IDs of a string of characters, of the specified encoding. |
GetGlyphs(String, UInt16[]) |
Obsolete.
Retrieve the corresponding glyph IDs of a string of characters. |
GetGlyphs(String) |
Retrieve the corresponding glyph IDs of a string of characters. |
GetKerningPairAdjustments(ReadOnlySpan<UInt16>) | |
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. |
ToFont() | |
ToFont(Single, Single, Single) | |
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
SkiaSharp