• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class Font

Defines a text font used for drawing text with Graphics.

Inheritance
object
Font
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DRIT.Drawing.Text
Assembly: DRIT.Drawing.dll
Syntax
public sealed class Font : IDisposable
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Constructors

Font(FontFamily, float)

Initializes a new Font with the specified font family and size.

Declaration
public Font(FontFamily family, float emSize)
Parameters
Type Name Description
FontFamily family

The font family.

float emSize

The em size of the font.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Font(FontFamily, float, FontStyle)

Initializes a new Font with the specified font family, size, and style.

Declaration
public Font(FontFamily family, float emSize, FontStyle style)
Parameters
Type Name Description
FontFamily family

The font family.

float emSize

The em size of the font.

FontStyle style

The style of the font.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Font(FontFamily, float, FontStyle, GraphicsUnit)

Initializes a new Font with the specified font family, size, style, and unit.

Declaration
public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit)
Parameters
Type Name Description
FontFamily family

The font family.

float emSize

The em size of the font.

FontStyle style

The style of the font.

GraphicsUnit unit

The unit of measurement for the font size.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Font(FontFamily, float, FontStyle, GraphicsUnit, byte)

Initializes a new Font with the specified font family, size, style, unit, and GDI character set.

Declaration
public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet)
Parameters
Type Name Description
FontFamily family

The font family.

float emSize

The em size of the font.

FontStyle style

The style of the font.

GraphicsUnit unit

The unit of measurement for the font size.

byte gdiCharSet

The GDI character set.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Font(string, float)

Initializes a new Font with the specified family name and size.

Declaration
public Font(string familyName, float emSize)
Parameters
Type Name Description
string familyName

The name of the font family.

float emSize

The em size of the font in the specified units.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Font(string, float, FontStyle)

Initializes a new Font with the specified family name, size, and style.

Declaration
public Font(string familyName, float emSize, FontStyle style)
Parameters
Type Name Description
string familyName

The name of the font family.

float emSize

The em size of the font in the specified units.

FontStyle style

The style of the font.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Font(string, float, FontStyle, GraphicsUnit)

Initializes a new Font with the specified family name, size, style, and unit.

Declaration
public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit)
Parameters
Type Name Description
string familyName

The name of the font family.

float emSize

The em size of the font.

FontStyle style

The style of the font.

GraphicsUnit unit

The unit of measurement for the font size.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Properties

Bold

Gets a value indicating whether this font is bold.

Declaration
public bool Bold { get; }
Property Value
Type Description
bool
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

FontFamily

Gets the font family used by this font.

Declaration
public FontFamily FontFamily { get; }
Property Value
Type Description
FontFamily
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

GdiCharSet

Gets the GDI character set.

Declaration
public byte GdiCharSet { get; }
Property Value
Type Description
byte
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

GdiVerticalFont

Gets a value indicating whether this font uses vertical GDI font metrics.

Declaration
public bool GdiVerticalFont { get; }
Property Value
Type Description
bool
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Height

Gets the line spacing height of this font in pixels.

Declaration
public int Height { get; }
Property Value
Type Description
int
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Italic

Gets a value indicating whether this font is italic.

Declaration
public bool Italic { get; }
Property Value
Type Description
bool
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Name

Gets the name of this font.

Declaration
public string Name { get; }
Property Value
Type Description
string
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

OriginalFontName

Gets the original font name passed to the constructor.

Declaration
public string OriginalFontName { get; }
Property Value
Type Description
string
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Size

Gets the size of this font in the specified units.

Declaration
public float Size { get; }
Property Value
Type Description
float
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

SizeInPoints

Gets the size of this font in points.

Declaration
public float SizeInPoints { get; }
Property Value
Type Description
float
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Strikeout

Gets a value indicating whether this font has strikethrough text.

Declaration
public bool Strikeout { get; }
Property Value
Type Description
bool
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Style

Gets the style of this font.

Declaration
public FontStyle Style { get; }
Property Value
Type Description
FontStyle
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Underline

Gets a value indicating whether this font has underlined text.

Declaration
public bool Underline { get; }
Property Value
Type Description
bool
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Unit

Gets the unit of measurement for the font size.

Declaration
public GraphicsUnit Unit { get; }
Property Value
Type Description
GraphicsUnit
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Methods

Clone()

Creates an exact copy of this font.

Declaration
public Font Clone()
Returns
Type Description
Font

A new Font with the same family, size, style, and unit.

Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Dispose()

Releases all resources used by this font.

Declaration
public void Dispose()
Remarks

A Font is created from a FontFamily and size, and can be styled with FontStyle flags. Fonts are used with Graphics.DrawString to render text.

Implements

IDisposable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX