# Font class

Namespace: [Eto.Drawing](https://eto.picoe.ca/api/namespace/eto.drawing.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
[TypeConverter(FontConverter)]
[Handler(Font.IHandler)]
public class Font : Widget
```

Defines a format for text

**Remarks:** A font is typically defined with a specified font family, with a given typeface. Each typeface has certain characteristics that define the variation of the font family, for example Bold, or Italic. You can get a list of [FontFamily](https://eto.picoe.ca/api/type/eto.drawing.fontfamily.md) objects available in the current system using [Fonts.AvailableFontFamilies](https://eto.picoe.ca/api/type/eto.drawing.fonts/availablefontfamilies.md), which can then be used to create an instance of a font.

## Constructors

- [Font](https://eto.picoe.ca/api/type/eto.drawing.font/ctor.md): (5 overloads) Creates a new instance of the Font class with a specified `family`, `size`, and `style`

## Properties

- [Ascent](https://eto.picoe.ca/api/type/eto.drawing.font/ascent.md): Gets the top y co-ordinate from the baseline to the tallest character ascent
- [Baseline](https://eto.picoe.ca/api/type/eto.drawing.font/baseline.md): Gets the offset of the baseline from the drawing point
- [Bold](https://eto.picoe.ca/api/type/eto.drawing.font/bold.md): Gets a value indicating that this font has a bold style
- [Descent](https://eto.picoe.ca/api/type/eto.drawing.font/descent.md): Gets the bottom y co-ordinate from the baseline to the longest character descent
- [Family](https://eto.picoe.ca/api/type/eto.drawing.font/family.md): Gets the family information for this font
- [FamilyName](https://eto.picoe.ca/api/type/eto.drawing.font/familyname.md): Gets the name of the family of this font
- [FontDecoration](https://eto.picoe.ca/api/type/eto.drawing.font/fontdecoration.md): Gets the decorations applied to the font
- [FontStyle](https://eto.picoe.ca/api/type/eto.drawing.font/fontstyle.md): Gets the style flags for this font
- [Italic](https://eto.picoe.ca/api/type/eto.drawing.font/italic.md): Gets a value indicating that this font has an italic style
- [Leading](https://eto.picoe.ca/api/type/eto.drawing.font/leading.md): Gets the leading space between each line
- [LineHeight](https://eto.picoe.ca/api/type/eto.drawing.font/lineheight.md): Gets the height of a single line of the font
- [Size](https://eto.picoe.ca/api/type/eto.drawing.font/size.md): Gets the size, in points, of this font
- [Strikethrough](https://eto.picoe.ca/api/type/eto.drawing.font/strikethrough.md): Gets a value indicating that this font has a strikethrough decoration
- [Typeface](https://eto.picoe.ca/api/type/eto.drawing.font/typeface.md): Gets the typeface information for this font
- [Underline](https://eto.picoe.ca/api/type/eto.drawing.font/underline.md): Gets a value indicating that this font has an underline decoration
- [UnderlinePosition](https://eto.picoe.ca/api/type/eto.drawing.font/underlineposition.md): Gets the offset of the underline from the baseline
- [UnderlineThickness](https://eto.picoe.ca/api/type/eto.drawing.font/underlinethickness.md): Gets the thickness of the underline
- [XHeight](https://eto.picoe.ca/api/type/eto.drawing.font/xheight.md): Gets the height of the lower case 'x' character

## Methods

- [Equals](https://eto.picoe.ca/api/type/eto.drawing.font/equals.md): Determines whether the specified [object](https://learn.microsoft.com/dotnet/api/system.object) is equal to the current [Font](https://eto.picoe.ca/api/type/eto.drawing.font.md).
- [FromFile](https://eto.picoe.ca/api/type/eto.drawing.font/fromfile.md): (static) Creates a new instance of the Font class with the specified font file on disk.
- [FromStream](https://eto.picoe.ca/api/type/eto.drawing.font/fromstream.md): (static) Creates a new instance of the Font class from the specified stream.
- [GetHashCode](https://eto.picoe.ca/api/type/eto.drawing.font/gethashcode.md): Serves as a hash function for a [Font](https://eto.picoe.ca/api/type/eto.drawing.font.md) object.
- [MeasureString](https://eto.picoe.ca/api/type/eto.drawing.font/measurestring.md): Measures the specified string to get its size in logical pixels.
- [ToString](https://eto.picoe.ca/api/type/eto.drawing.font/tostring.md): Gets a string representation of the font object

## Inherited Members

- From [Widget](https://eto.picoe.ca/api/type/eto.widget.md): [ControlObject](https://eto.picoe.ca/api/type/eto.widget/controlobject.md), [Handler](https://eto.picoe.ca/api/type/eto.widget/handler.md), [ID](https://eto.picoe.ca/api/type/eto.widget/id.md), [IsDisposed](https://eto.picoe.ca/api/type/eto.widget/isdisposed.md), [NativeHandle](https://eto.picoe.ca/api/type/eto.widget/nativehandle.md), [Platform](https://eto.picoe.ca/api/type/eto.widget/platform.md), [Properties](https://eto.picoe.ca/api/type/eto.widget/properties.md), [Style](https://eto.picoe.ca/api/type/eto.widget/style.md), [StyleChanged](https://eto.picoe.ca/api/type/eto.widget/stylechanged.md), [Dispose](https://eto.picoe.ca/api/type/eto.widget/dispose.md), [GetCallback](https://eto.picoe.ca/api/type/eto.widget/getcallback.md), [Initialize](https://eto.picoe.ca/api/type/eto.widget/initialize.md), [OnStyleChanged](https://eto.picoe.ca/api/type/eto.widget/onstylechanged.md)
