# IPlatformTypeface

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/trait-iplatformtypeface/

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

```rust
trait IPlatformTypeface: IFontMemory
```

Represents a platform-specific typeface: a font face as loaded by the
font backend, exposing its identity and raw table data.

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

## Members

- [`family_name`](#function-family_name)
- [`weight`](#function-weight)
- [`style`](#function-style)
- [`stretch`](#function-stretch)
- [`font_simulations`](#function-font_simulations)
- [`try_get_stream`](#function-try_get_stream)
- [`as_any`](#function-as_any)

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

### family_name

```rust
fn family_name(self: &Self) -> String
```

Gets the family name of the font.

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

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

### weight

```rust
fn weight(self: &Self) -> FontWeight
```

Gets the designed weight of the font.

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

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

### style

```rust
fn style(self: &Self) -> FontStyle
```

Gets the style of the font.

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

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

### stretch

```rust
fn stretch(self: &Self) -> FontStretch
```

Gets the designed stretch of the font.

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

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

### font_simulations

```rust
fn font_simulations(self: &Self) -> FontSimulations
```

Gets the algorithmic style simulations applied to this typeface.

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

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

### try_get_stream

```rust
fn try_get_stream(self: &Self) -> Option<Box<dyn Read>>
```

Attempts to obtain a stream over the raw font data.

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

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

### as_any

```rust
fn as_any(self: &Self) -> &dyn Any
```

Lets the backend that created the typeface recover its concrete type
(C#'s type test `PlatformTypeface is SkiaTypeface`).

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

## Availability

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