# FontMetrics

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-fontmetrics/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct FontMetrics
```

The font metrics is holding information about a font's ascent, descent, etc.
in design em units.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L4)

## Members

- [`design_em_height`](#struct_field-design_em_height)
- [`is_fixed_pitch`](#struct_field-is_fixed_pitch)
- [`ascent`](#struct_field-ascent)
- [`descent`](#struct_field-descent)
- [`line_gap`](#struct_field-line_gap)
- [`underline_position`](#struct_field-underline_position)
- [`underline_thickness`](#struct_field-underline_thickness)
- [`strikethrough_position`](#struct_field-strikethrough_position)
- [`strikethrough_thickness`](#struct_field-strikethrough_thickness)
- [`cap_height`](#struct_field-cap_height)
- [`line_spacing`](#function-line_spacing)

<a id="struct_field-design_em_height"></a>

### design_em_height

```rust
design_em_height: u16
```

The font design units per em.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L6)

<a id="struct_field-is_fixed_pitch"></a>

### is_fixed_pitch

```rust
is_fixed_pitch: bool
```

Whether all glyphs have the same advance.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L8)

<a id="struct_field-ascent"></a>

### ascent

```rust
ascent: i32
```

The recommended distance above the baseline in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L10)

<a id="struct_field-descent"></a>

### descent

```rust
descent: i32
```

The recommended distance under the baseline in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L12)

<a id="struct_field-line_gap"></a>

### line_gap

```rust
line_gap: i32
```

The recommended additional space between two lines of text in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L14)

<a id="struct_field-underline_position"></a>

### underline_position

```rust
underline_position: i32
```

A value that indicates the distance of the underline from the baseline in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L16)

<a id="struct_field-underline_thickness"></a>

### underline_thickness

```rust
underline_thickness: i32
```

A value that indicates the thickness of the underline in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L18)

<a id="struct_field-strikethrough_position"></a>

### strikethrough_position

```rust
strikethrough_position: i32
```

A value that indicates the distance of the strikethrough from the baseline in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L20)

<a id="struct_field-strikethrough_thickness"></a>

### strikethrough_thickness

```rust
strikethrough_thickness: i32
```

A value that indicates the thickness of the strikethrough in design em size.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L22)

<a id="struct_field-cap_height"></a>

### cap_height

```rust
cap_height: i32
```

The height of the capital letters above the baseline in design em size (positive). A
FerroUI addition (docs/porting/DEVIATIONS.md, Fonts): the `sCapHeight` of the OS/2
table, or the top of the glyph of "H" for a font whose table has none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L26)

<a id="function-line_spacing"></a>

### line_spacing

```rust
fn line_spacing(self: &Self) -> i32
```

The line spacing in the design em size (`descent - ascent + line_gap`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/font_metrics.rs#L32)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
