Class FontInstance
provide metadata about a font.
Implements
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public class FontInstance : IFontInstance
Properties
| Improve this Doc View SourceAscender
Gets the ascender.
Declaration
public short Ascender { get; }
Property Value
Type | Description |
---|---|
Int16 |
Descender
Gets the descender.
Declaration
public short Descender { get; }
Property Value
Type | Description |
---|---|
Int16 |
Description
Gets the basic descripton of the font instance type.
Declaration
public FontDescription Description { get; }
Property Value
Type | Description |
---|---|
FontDescription |
EmSize
Gets the size of the em.
Declaration
public ushort EmSize { get; }
Property Value
Type | Description |
---|---|
UInt16 | The size of the em. |
LineGap
Gets the line gap.
Declaration
public short LineGap { get; }
Property Value
Type | Description |
---|---|
Int16 |
LineHeight
Gets the height of the line.
Declaration
public int LineHeight { get; }
Property Value
Type | Description |
---|---|
Int32 | The height of the line. |
Methods
| Improve this Doc View SourceLoadFont(Stream)
Reads a FontInstance from the specified stream.
Declaration
public static FontInstance LoadFont(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Returns
Type | Description |
---|---|
FontInstance | a FontInstance. |
LoadFont(String)
Reads a FontInstance from the specified stream.
Declaration
public static FontInstance LoadFont(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The file path. |
Returns
Type | Description |
---|---|
FontInstance | a FontInstance. |
LoadFont(String, Int64)
Reads a FontInstance from the specified stream.
Declaration
public static FontInstance LoadFont(string path, long offset)
Parameters
Type | Name | Description |
---|---|---|
String | path | The file path. |
Int64 | offset | Position in the stream to read the font from. |
Returns
Type | Description |
---|---|
FontInstance | a FontInstance. |
LoadFontCollection(Stream)
Reads a FontInstance from the specified stream.
Declaration
public static FontInstance[] LoadFontCollection(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Returns
Type | Description |
---|---|
FontInstance[] | a FontInstance. |
LoadFontCollection(String)
Reads a FontInstance from the specified stream.
Declaration
public static FontInstance[] LoadFontCollection(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The file path. |
Returns
Type | Description |
---|---|
FontInstance[] | a FontInstance. |
Explicit Interface Implementations
| Improve this Doc View SourceIFontInstance.GetGlyph(Int32)
Gets the glyph.
Declaration
GlyphInstance IFontInstance.GetGlyph(int codePoint)
Parameters
Type | Name | Description |
---|---|---|
Int32 | codePoint | The code point of the character. |
Returns
Type | Description |
---|---|
GlyphInstance | the glyph for a known character. |
IFontInstance.GetOffset(GlyphInstance, GlyphInstance)
Gets the amount the glyph
should be ofset if it was proceeded by the previousGlyph
.
Declaration
Vector2 IFontInstance.GetOffset(GlyphInstance glyph, GlyphInstance previousGlyph)
Parameters
Type | Name | Description |
---|---|---|
GlyphInstance | glyph | The glyph. |
GlyphInstance | previousGlyph | The previous glyph. |
Returns
Type | Description |
---|---|
Vector2 | A Vector2 represting the offset that should be applied to the |