# FontFallbackMapping

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

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

```rust
struct FontFallbackMapping
```

The font and scale selected for a nonempty prefix of logical UTF-16 text.
The scale is relative to the source font size; it is never cumulative.

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

## Members

- [`new`](#function-new)
- [`glyph_typeface`](#function-glyph_typeface)
- [`typeface`](#function-typeface)
- [`mapped_length`](#function-mapped_length)
- [`scale`](#function-scale)

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

### new

```rust
fn new(glyph_typeface: Rc<GlyphTypeface>, mapped_length: usize, scale: f64) -> Option<Self>
```

Creates a mapping with a finite positive scale and a nonzero length.
Returns `None` for invalid values or an unnamed glyph face. The
formatter additionally checks the length against the offered text,
Unicode boundaries, glyph coverage and the effective em size.

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

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

### glyph_typeface

```rust
fn glyph_typeface(self: &Self) -> &Rc<GlyphTypeface>
```

The actual selected face, retained for shaping and rendering.

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

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

### typeface

```rust
fn typeface(self: &Self) -> &Typeface
```

Descriptive face metadata. Shaping uses the retained actual glyph face.

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

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

### mapped_length

```rust
fn mapped_length(self: &Self) -> usize
```

The nonempty prefix length in logical UTF-16 code units.

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

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

### scale

```rust
fn scale(self: &Self) -> f64
```

A finite positive multiplier of the source's requested font size.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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`

## Availability

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