# FontVersion

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

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

```rust
struct FontVersion
```

Represents a Version16Dot16 value from OpenType font tables.
The high 16 bits represent the major version, and the low 16 bits represent
the minor version as a fraction.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L7)

## Members

- [`major`](#struct_field-major)
- [`minor`](#struct_field-minor)
- [`new`](#function-new)
- [`from_parts`](#function-from_parts)
- [`to_float`](#function-to_float)
- [`to_uint32`](#function-to_uint32)

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

### major

```rust
major: u16
```

The major version number.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L9)

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

### minor

```rust
minor: u16
```

The minor version number (as a fraction of 65536).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L11)

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

### new

```rust
const fn new(value: u32) -> Self
```

Creates the version from a raw 32-bit Version16Dot16 value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L17)

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

### from_parts

```rust
const fn from_parts(major: u16, minor: u16) -> Self
```

Creates the version from major and minor components.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L23)

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

### to_float

```rust
fn to_float(self: &Self) -> f32
```

Converts the version to a floating-point representation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L29)

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

### to_uint32

```rust
const fn to_uint32(self: &Self) -> u32
```

Returns the raw 32-bit Version16Dot16 value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/tables/font_version.rs#L35)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`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`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `Default`
- `Display`
- `From<FontVersion>`

## Availability

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