Font 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 font face.
public class Font : HarfBuzzSharp.NativeObject
- Inheritance
Constructors
| Name | Description |
|---|---|
| Font(Face) |
Initializes a new instance of the Font class using a specific font face. |
| Font(Font) |
Initializes a new instance of the Font class as a sub-font of the specified parent font. |
Properties
| Name | Description |
|---|---|
| Handle |
Gets or sets the handle to the underlying native object. (Inherited from NativeObject) |
| OpenTypeMetrics |
Gets access to OpenType metrics for this font. |
| Parent |
Gets the parent font, if this font was created as a sub-font. |
| SupportedShapers |
Gets the list of supported shaper names. |
Methods
| Name | Description |
|---|---|
| Dispose() |
Releases all resources used by this NativeObject. (Inherited from NativeObject) |
| Dispose(Boolean) |
Releases the unmanaged resources used by the Font and optionally releases the managed resources. |
| DisposeHandler() |
Releases the unmanaged resources used. |
| GetFontExtentsForDirection(Direction) |
Gets the font extents for the specified text direction. |
| GetGlyphAdvanceForDirection(UInt32, Direction, Int32, Int32) |
Gets the advance of a glyph for the specified direction. |
| GetGlyphAdvancesForDirection(IntPtr, Int32, Direction) |
Gets the advances of multiple glyphs for the specified direction. |
| GetGlyphAdvancesForDirection(ReadOnlySpan<UInt32>, Direction) |
Gets the advances of multiple glyphs for the specified direction. |
| GetHorizontalGlyphAdvance(UInt32) |
Gets the horizontal advance width of a glyph. |
| GetHorizontalGlyphAdvances(IntPtr, Int32) |
Gets the horizontal advance widths of multiple glyphs. |
| GetHorizontalGlyphAdvances(ReadOnlySpan<UInt32>) |
Gets the horizontal advance widths of multiple glyphs. |
| GetHorizontalGlyphKerning(UInt32, UInt32) |
Gets the horizontal kerning adjustment between two glyphs. |
| GetScale(Int32, Int32) |
Retrieves the font scale. |
| GetVerticalGlyphAdvance(UInt32) |
Gets the vertical advance height of a glyph. |
| GetVerticalGlyphAdvances(IntPtr, Int32) |
Gets the vertical advance heights of multiple glyphs. |
| GetVerticalGlyphAdvances(ReadOnlySpan<UInt32>) |
Gets the vertical advance heights of multiple glyphs. |
| GlyphToString(UInt32) |
Converts a glyph ID to its string representation. |
| SetFontFunctions(FontFunctions, Object, ReleaseDelegate) |
Sets custom font functions for this font with associated user data and a destroy callback. |
| SetFontFunctions(FontFunctions, Object) |
Sets custom font functions for this font with associated user data. |
| SetFontFunctions(FontFunctions) |
Sets custom font functions for this font. |
| SetFunctionsOpenType() |
Sets the font functions to that of OpenType. |
| SetScale(Int32, Int32) |
Sets the font scale. |
| Shape(Buffer, Feature[]) |
Shapes the specified buffer using the current font. |
| Shape(Buffer, IReadOnlyList<Feature>, IReadOnlyList<String>) |
Shapes the specified buffer using the current font with explicit shapers. |
| TryGetGlyph(Int32, UInt32, UInt32) |
Tries to get the glyph ID for a Unicode code point with a variation selector. |
| TryGetGlyph(Int32, UInt32) |
Tries to get the glyph ID for a Unicode code point. |
| TryGetGlyph(UInt32, UInt32, UInt32) |
Tries to get the glyph ID for a Unicode code point with a variation selector. |
| TryGetGlyph(UInt32, UInt32) |
Tries to get the glyph ID for a Unicode code point. |
| TryGetGlyphContourPoint(UInt32, UInt32, Int32, Int32) |
Tries to get the coordinates of a contour point in a glyph. |
| TryGetGlyphContourPointForOrigin(UInt32, UInt32, Direction, Int32, Int32) |
Tries to get the coordinates of a contour point in a glyph, adjusted for text direction. |
| TryGetGlyphExtents(UInt32, GlyphExtents) |
Tries to get the extents (bounding box) of a glyph. |
| TryGetGlyphFromName(String, UInt32) |
Tries to get the glyph ID for a glyph name. |
| TryGetGlyphFromString(String, UInt32) |
Tries to parse a string to get a glyph ID. |
| TryGetGlyphName(UInt32, String) |
Tries to get the name of a glyph. |
| TryGetHorizontalFontExtents(FontExtents) |
Tries to get the horizontal extents of the font. |
| TryGetHorizontalGlyphOrigin(UInt32, Int32, Int32) |
Tries to get the horizontal origin of a glyph. |
| TryGetNominalGlyph(Int32, UInt32) |
Tries to get the nominal glyph ID for a Unicode code point. |
| TryGetNominalGlyph(UInt32, UInt32) |
Tries to get the nominal glyph ID for a Unicode code point. |
| TryGetVariationGlyph(Int32, UInt32, UInt32) |
Tries to get a variation glyph for a Unicode code point with a specific variation selector. |
| TryGetVariationGlyph(Int32, UInt32) |
Tries to get a variation glyph for a Unicode code point. |
| TryGetVariationGlyph(UInt32, UInt32, UInt32) |
Tries to get a variation glyph for a Unicode code point with a specific variation selector. |
| TryGetVariationGlyph(UInt32, UInt32) |
Tries to get a variation glyph for a Unicode code point. |
| TryGetVerticalFontExtents(FontExtents) |
Tries to get the vertical extents of the font. |
| TryGetVerticalGlyphOrigin(UInt32, Int32, Int32) |
Tries to get the vertical origin of a glyph. |