Class Font
Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public sealed class Font
Constructors
| Improve this Doc View SourceFont(Font, FontStyle)
Initializes a new instance of the Font class.
Declaration
public Font(Font prototype, FontStyle style)
Parameters
Type | Name | Description |
---|---|---|
Font | prototype | The prototype. |
FontStyle | style | The style. |
Font(Font, Single)
Initializes a new instance of the Font class.
Declaration
public Font(Font prototype, float size)
Parameters
Type | Name | Description |
---|---|---|
Font | prototype | The prototype. |
Single | size | The size. |
Font(Font, Single, FontStyle)
Initializes a new instance of the Font class.
Declaration
public Font(Font prototype, float size, FontStyle style)
Parameters
Type | Name | Description |
---|---|---|
Font | prototype | The prototype. |
Single | size | The size. |
FontStyle | style | The style. |
Font(FontFamily, Single)
Initializes a new instance of the Font class.
Declaration
public Font(FontFamily family, float size)
Parameters
Type | Name | Description |
---|---|---|
FontFamily | family | The family. |
Single | size | The size. |
Font(FontFamily, Single, FontStyle)
Initializes a new instance of the Font class.
Declaration
public Font(FontFamily family, float size, FontStyle style)
Parameters
Type | Name | Description |
---|---|---|
FontFamily | family | The family. |
Single | size | The size. |
FontStyle | style | The style. |
Properties
| Improve this Doc View SourceAscender
Gets the ascender (from the OS/2 table field TypoAscender
).
Declaration
public short Ascender { get; }
Property Value
Type | Description |
---|---|
Int16 |
Bold
Gets a value indicating whether this Font is bold.
Declaration
public bool Bold { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
Descender
Gets the descender (from the OS/2 table field TypoDescender
).
Declaration
public short Descender { get; }
Property Value
Type | Description |
---|---|
Int16 |
EmSize
Gets the size of the em.
Declaration
public ushort EmSize { get; }
Property Value
Type | Description |
---|---|
UInt16 | The size of the em. |
Family
Gets the family.
Declaration
public FontFamily Family { get; }
Property Value
Type | Description |
---|---|
FontFamily | The family. |
Instance
Gets the font instance.
Declaration
public IFontInstance Instance { get; }
Property Value
Type | Description |
---|---|
IFontInstance | The font instance. |
Italic
Gets a value indicating whether this Font is italic.
Declaration
public bool Italic { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
LineGap
Gets the line gap (from the OS/2 table field TypoLineGap
).
Declaration
public short LineGap { get; }
Property Value
Type | Description |
---|---|
Int16 |
LineHeight
Gets the line height.
Declaration
public int LineHeight { get; }
Property Value
Type | Description |
---|---|
Int32 |
Name
Gets the name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String | The name. |
Size
Gets the size.
Declaration
public float Size { get; }
Property Value
Type | Description |
---|---|
Single | The size. |
Methods
| Improve this Doc View SourceGetGlyph(Int32)
Gets the glyph.
Declaration
public Glyph GetGlyph(int codePoint)
Parameters
Type | Name | Description |
---|---|---|
Int32 | codePoint | The code point of the character. |
Returns
Type | Description |
---|---|
Glyph | Returns the glyph |