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 font, along with optionally algorithmic settings like SKFont.Size, SKFont.SkewX, SKFont.ScaleX, and SKFont.Embolden to specify how text appears when drawn (and measured).
Typeface objects are immutable, and so they can be shared between threads.
Properties
| Name | Description |
|---|---|
| Default |
Gets the default, Normal typeface. |
| Empty |
Gets a shared empty SKTypeface instance. |
| 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 |
Gets the number of glyphs in this typeface. |
| Handle |
Gets or sets the handle to the underlying native object. (Inherited from SKObject) |
| HasGetKerningPairAdjustments |
Gets a value indicating whether this typeface supports retrieving kerning pair adjustments. |
| IgnorePublicDispose |
Gets 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 a value indicating whether the object has already been disposed. (Inherited from SKNativeObject) |
| IsEmpty |
Gets a value indicating whether this typeface is the empty typeface. |
| 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 or sets a value indicating whether this object owns its handle and should destroy the native object when it is disposed. (Inherited from SKNativeObject) |
| PostScriptName |
Gets the PostScript name of this typeface. |
| 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. |
| VariationDesignParameterCount |
Gets the number of variation design parameters (axes) in this typeface. |
| VariationDesignParameters |
Gets all variation design parameters (axes) defined in this typeface. |
| VariationDesignPosition |
Gets the current variation design position of this typeface. |
| VariationDesignPositionCount |
Gets the number of axes in the current variation design position of this typeface. |
Methods
| Name | Description |
|---|---|
| Clone(Int32) |
Creates a new typeface derived from this typeface using the specified color palette index. |
| Clone(ReadOnlySpan<SKFontVariationPositionCoordinate>) |
Creates a new typeface derived from this typeface with the specified variation design position. |
| Clone(SKFontArguments) |
Creates a new typeface derived from this typeface with the specified font arguments. |
| ContainsGlyph(Int32) |
Obsolete.
Determines whether this typeface contains a glyph for the specified Unicode codepoint. |
| ContainsGlyphs(IntPtr, Int32, SKTextEncoding) |
Obsolete.
Determines whether this typeface contains glyphs for all characters in the specified buffer. |
| ContainsGlyphs(ReadOnlySpan<Byte>, SKTextEncoding) |
Obsolete.
Determines whether this typeface contains glyphs for all characters in the specified buffer. |
| ContainsGlyphs(ReadOnlySpan<Char>) |
Obsolete.
Determines whether this typeface contains glyphs for all characters in the specified text. |
| ContainsGlyphs(ReadOnlySpan<Int32>) |
Obsolete.
Determines whether this typeface contains glyphs for all the specified Unicode codepoints. |
| ContainsGlyphs(String) |
Obsolete.
Determines whether this typeface contains glyphs for all characters in the specified text. |
| CountGlyphs(Byte[], SKTextEncoding) |
Obsolete.
Returns the number of glyphs in the buffer. |
| CountGlyphs(IntPtr, Int32, SKTextEncoding) |
Obsolete.
Returns the number of glyphs in the specified buffer. |
| CountGlyphs(ReadOnlySpan<Byte>, SKTextEncoding) |
Obsolete.
Returns the number of glyphs in the buffer. |
| CountGlyphs(ReadOnlySpan<Char>) |
Obsolete.
Returns the number of glyphs in the text. |
| CountGlyphs(String) |
Obsolete.
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() |
Implemented by derived SKObject types to dispose managed objects that are not owned by this instance. (Inherited from SKObject) |
| FromData(SKData, Int32) |
Returns a new typeface given data. |
| FromFamilyName(String, Int32, Int32, SKFontStyleSlant) |
Returns 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) |
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. |
| GetGlyph(Int32) |
Obsolete.
Returns the glyph ID for the specified Unicode codepoint. |
| GetGlyphs(IntPtr, Int32, SKTextEncoding) |
Returns the glyph IDs for the specified buffer of character codes. |
| GetGlyphs(ReadOnlySpan<Byte>, SKTextEncoding) |
Returns the glyph IDs for the specified buffer of character codes. |
| GetGlyphs(ReadOnlySpan<Char>) |
Returns the glyph IDs for the specified text. |
| GetGlyphs(ReadOnlySpan<Int32>) |
Obsolete.
Returns the glyph IDs for the specified Unicode codepoints. |
| GetGlyphs(String) |
Retrieve the corresponding glyph IDs of a string of characters. |
| GetKerningPairAdjustments(ReadOnlySpan<UInt16>, Span<Int32>) |
Gets the kerning pair adjustments for the specified glyphs. |
| GetKerningPairAdjustments(ReadOnlySpan<UInt16>) |
Returns kerning pair adjustments for the specified glyphs. |
| 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. |
| GetVariationDesignParameters(Span<SKFontVariationAxis>) |
Fills a span with the variation design parameters (axes) defined in this typeface. |
| GetVariationDesignPosition(Span<SKFontVariationPositionCoordinate>) |
Fills a span with the current variation design position of this typeface. |
| OpenStream() |
Returns a stream for the contents of the font data. |
| OpenStream(Int32) |
Returns a stream for the contents of the font data. |
| ToFont() |
Creates a new SKFont from this typeface with default settings. |
| ToFont(Single, Single, Single) |
Creates a new SKFont from this typeface with the specified size and style parameters. |
| 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. |