# OfficeFontInfo

Small immutable font descriptor used by OfficeIMO packages without taking a dependency on a font engine.

Struct 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeFontInfo.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L13)

**Base**

`ValueType`

**Implements**

`IEquatable<OfficeFontInfo>`

**Modifiers**

sealed

Small immutable font descriptor used by OfficeIMO packages without taking a dependency on a font engine.

## Inheritance

- ValueType
- OfficeFontInfo

## Usage

Explore 26 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 9

- Property [OfficeDrawingText.Font](/api/core/officeimo-drawing-officedrawingtext/#property-font)
- Method [OfficeFontInfo.WithFace](/api/core/officeimo-drawing-officefontinfo/#method-withface-officeimo-drawing-officefontfacedescriptor)
- Method [OfficeFontInfo.WithFamilyName](/api/core/officeimo-drawing-officefontinfo/#method-withfamilyname-string)
- Method [OfficeFontInfo.WithSize](/api/core/officeimo-drawing-officefontinfo/#method-withsize-double)
- Method [OfficeFontInfo.WithStyle](/api/core/officeimo-drawing-officefontinfo/#method-withstyle-officeimo-drawing-officefontstyle)
- Property [OfficeFontInfo.Default](/api/core/officeimo-drawing-officefontinfo/#property-default)
- Property [OfficeMathRenderOptions.Font](/api/core/officeimo-drawing-officemathrenderoptions/#property-font)
- Property [OfficeTextMeasurementStyle.FontInfo](/api/core/officeimo-drawing-officetextmeasurementstyle/#property-fontinfo)
- Property [OfficeTextMeasurer.FallbackFontInfo](/api/core/officeimo-drawing-officetextmeasurer/#property-fallbackfontinfo)

### Accepted by parameters 17

- Method [OfficeDrawing.AddClippedPositionedText](/api/core/officeimo-drawing-officedrawing/#method-addclippedpositionedtext-string-double-double-double-double-double-double-officeimo-drawing-officeclippath-officeimo-drawing-officeimageframetransform-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double-nullable-system-double) parameter `font`
- Method [OfficeDrawing.AddClippedText](/api/core/officeimo-drawing-officedrawing/#method-addclippedtext-string-double-double-double-double-double-double-officeimo-drawing-officeclippath-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double-officeimo-drawing-officetextverticalalignment-double-nullable-system-double-nullable-system-double-boolean-boolean-boolean-boolean-boolean-nullable-officeimo-drawing-officetextpadding-nullable-officeimo-drawing-officetextparagraphindent) parameter `font`
- Method [OfficeDrawing.AddPositionedText](/api/core/officeimo-drawing-officedrawing/#method-addpositionedtext-string-double-double-double-double-officeimo-drawing-officeimageframetransform-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double-nullable-system-double) parameter `font`
- Method [OfficeDrawing.AddStyledText](/api/core/officeimo-drawing-officedrawing/#method-addstyledtext-string-double-double-double-double-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double-officeimo-drawing-officetextverticalalignment-double-nullable-system-double-nullable-system-double-boolean-boolean-boolean-boolean-boolean-nullable-officeimo-drawing-officetextpadding-nullable-officeimo-drawing-officetextparagraphindent-officeimo-drawing-officetextdecorationstyle-officeimo-drawing-officetextdecorationstyle-officeimo-drawing-officetextbaseline) parameter `font`
- Method [OfficeDrawing.AddText](/api/core/officeimo-drawing-officedrawing/#method-addtext-string-double-double-double-double-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double) parameter `font`
- Method [OfficeDrawing.AddTextBehindContent](/api/core/officeimo-drawing-officedrawing/#method-addtextbehindcontent-string-double-double-double-double-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double-officeimo-drawing-officetextverticalalignment-double-nullable-system-double-nullable-system-double-boolean-boolean-boolean-boolean-boolean-nullable-officeimo-drawing-officetextpadding-nullable-officeimo-drawing-officetextparagraphindent) parameter `font`
- Method [OfficeDrawing.AddVerticalText](/api/core/officeimo-drawing-officedrawing/#method-addverticaltext-string-double-double-double-double-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor) parameter `font`
- Constructor [OfficeDrawingText.OfficeDrawingText](/api/core/officeimo-drawing-officedrawingtext/#constructor-ctor-string-double-double-double-double-nullable-officeimo-drawing-officefontinfo-nullable-officeimo-officecolor-officeimo-drawing-officetextalignment-nullable-system-double) parameter `font`
- Method [OfficeFontInfo.Equals](/api/core/officeimo-drawing-officefontinfo/#method-equals-officeimo-drawing-officefontinfo) parameter `other`
- Method [OfficeFontInfo.op_Equality](/api/core/officeimo-drawing-officefontinfo/#method-op-equality-officeimo-drawing-officefontinfo-officeimo-drawing-officefontinfo) parameter `left`
- Method [OfficeFontInfo.op_Equality](/api/core/officeimo-drawing-officefontinfo/#method-op-equality-officeimo-drawing-officefontinfo-officeimo-drawing-officefontinfo) parameter `right`
- Method [OfficeFontInfo.op_Inequality](/api/core/officeimo-drawing-officefontinfo/#method-op-inequality-officeimo-drawing-officefontinfo-officeimo-drawing-officefontinfo) parameter `left`
- Method [OfficeFontInfo.op_Inequality](/api/core/officeimo-drawing-officefontinfo/#method-op-inequality-officeimo-drawing-officefontinfo-officeimo-drawing-officefontinfo) parameter `right`
- Method [OfficeRasterCanvas.DrawText](/api/core/officeimo-drawing-officerastercanvas/#method-drawtext-string-double-double-double-double-officeimo-officecolor-officeimo-drawing-officefontinfo-officeimo-drawing-officetextalignment) parameter `font`
- Method [OfficeRasterCanvas.MeasureText](/api/core/officeimo-drawing-officerastercanvas/#method-measuretext-string-officeimo-drawing-officefontinfo) parameter `font`
- Method [OfficeTextMeasurer.Create](/api/core/officeimo-drawing-officetextmeasurer/#method-create-nullable-officeimo-drawing-officefontinfo) parameter `fallbackFontInfo`
- Method [OfficeTextMeasurer.CreateStyle](/api/core/officeimo-drawing-officetextmeasurer/#method-createstyle-officeimo-drawing-officefontinfo) parameter `fontInfo`

Filter members 

Show inherited

## Constructors

OfficeFontInfo 2 overloads

`public OfficeFontInfo(string? familyName, double size = 11, OfficeFontStyle style = Regular)` [#](#constructor-ctor-string-double-officeimo-drawing-officefontstyle)

[OfficeFontInfo.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L13)

Creates a font descriptor.

Parameters

**familyName string? required**

**size double = 11 optional**

**style OfficeIMO.Drawing.OfficeFontStyle = Regular optional**

`public OfficeFontInfo(string? familyName, double size, OfficeFontFaceDescriptor face, OfficeFontStyle decorations = Regular)` [#](#constructor-ctor-string-double-officeimo-drawing-officefontfacedescriptor-officeimo-drawing-officefontstyle)

[OfficeFontInfo.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L21)

Creates a font with exact numeric face attributes and optional text decorations.

Parameters

**familyName string? required**

**size double required**

**face OfficeIMO.Drawing.OfficeFontFaceDescriptor required**

**decorations OfficeIMO.Drawing.OfficeFontStyle = Regular optional**

## Methods

Equals 2 overloads

`public bool Equals(OfficeFontInfo other)` [#](#method-equals-officeimo-drawing-officefontinfo)

[OfficeFontInfo.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L75)

Indicates whether the current object is equal to another object of the same type.

Parameters

**other OfficeIMO.Drawing.OfficeFontInfo required**

An object to compare with this object.

Returns

`bool` true if the current object is equal to the other parameter; otherwise, false.

`public override bool Equals(object? obj)` [#](#method-equals-object)

[OfficeFontInfo.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L80)

Indicates whether this instance and a specified object are equal.

Parameters

**obj object? required**

The object to compare with the current instance.

Returns

`bool` true if obj and this instance are the same type and represent the same value; otherwise, false.

`public override int GetHashCode()` [#](#method-gethashcode)

[OfficeFontInfo.cs:85](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L85)

Returns the hash code for this instance.

Returns

`int` A 32-bit signed integer that is the hash code for this instance.

`public static bool op_Equality(OfficeFontInfo left, OfficeFontInfo right)` [#](#method-op-equality-officeimo-drawing-officefontinfo-officeimo-drawing-officefontinfo)

[OfficeFontInfo.cs:102](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L102)

Equality operator.

Parameters

**left OfficeIMO.Drawing.OfficeFontInfo required**

**right OfficeIMO.Drawing.OfficeFontInfo required**

Returns

`bool`

`public static bool op_Inequality(OfficeFontInfo left, OfficeFontInfo right)` [#](#method-op-inequality-officeimo-drawing-officefontinfo-officeimo-drawing-officefontinfo)

[OfficeFontInfo.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L105)

Inequality operator.

Parameters

**left OfficeIMO.Drawing.OfficeFontInfo required**

**right OfficeIMO.Drawing.OfficeFontInfo required**

Returns

`bool`

`public override string ToString()` [#](#method-tostring)

[OfficeFontInfo.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L96)

Returns the fully qualified type name of this instance.

Returns

`string` The fully qualified type name.

`public OfficeFontInfo WithFace(OfficeFontFaceDescriptor face)` [#](#method-withface-officeimo-drawing-officefontfacedescriptor)

[OfficeFontInfo.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L71)

Creates a copy with exact face attributes, retaining text decorations.

Parameters

**face OfficeIMO.Drawing.OfficeFontFaceDescriptor required**

Returns

`OfficeFontInfo`

`public OfficeFontInfo WithFamilyName(string? familyName)` [#](#method-withfamilyname-string)

[OfficeFontInfo.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L55)

Creates a copy with a different family name.

Parameters

**familyName string? required**

Returns

`OfficeFontInfo`

`public OfficeFontInfo WithSize(double size)` [#](#method-withsize-double)

[OfficeFontInfo.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L58)

Creates a copy with a different point size.

Parameters

**size double required**

Returns

`OfficeFontInfo`

`public OfficeFontInfo WithStyle(OfficeFontStyle style)` [#](#method-withstyle-officeimo-drawing-officefontstyle)

[OfficeFontInfo.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L62)

Creates a copy with different style flags.

Parameters

**style OfficeIMO.Drawing.OfficeFontStyle required**

Returns

`OfficeFontInfo`

## Inherited Methods

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

## Properties

`public string FamilyName { get; }` [#](#property-familyname)

[OfficeFontInfo.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L28)

Font family name, when known.

`public double Size { get; }` [#](#property-size)

[OfficeFontInfo.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L31)

Font size interpreted in the drawing or measurement context.

`public OfficeFontStyle Style { get; }` [#](#property-style)

[OfficeFontInfo.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L34)

Font style flags.

`public OfficeFontFaceDescriptor Face { get; }` [#](#property-face)

[OfficeFontInfo.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L37)

Numeric weight, width, and slant used consistently for measurement, painting, and export.

`public bool IsBold { get; }` [#](#property-isbold)

[OfficeFontInfo.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L40)

Whether the descriptor includes bold styling.

`public bool IsItalic { get; }` [#](#property-isitalic)

[OfficeFontInfo.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L43)

Whether the descriptor includes italic styling.

`public bool IsUnderline { get; }` [#](#property-isunderline)

[OfficeFontInfo.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L46)

Whether the descriptor includes underline styling.

`public bool IsStrikethrough { get; }` [#](#property-isstrikethrough)

[OfficeFontInfo.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L49)

Whether the descriptor includes strikethrough styling.

`public static OfficeFontInfo Default { get; }` [#](#property-default)

[OfficeFontInfo.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeFontInfo.cs#L52)

Default Office font descriptor.

<!-- PowerForge markdown artifact sha256:A8D7044C3111E45FA11F8D2C0DC2D757A51D66B822191151C0AF0648070C2ED8 -->
