# TextRunProperties

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

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

```rust
trait TextRunProperties: 'static
```

Properties that can change from one run to the next, such as typeface or
foreground brush.

Handled as `Rc<dyn TextRunProperties>`; compare with `==` on the trait
object (value equality of the members, as upstream's `Equals`).

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

## Members

- [`typeface`](#function-typeface)
- [`requested_font_family`](#function-requested_font_family)
- [`font_rendering_em_size`](#function-font_rendering_em_size)
- [`font_scale`](#function-font_scale)
- [`effective_font_rendering_em_size`](#function-effective_font_rendering_em_size)
- [`text_decorations`](#function-text_decorations)
- [`foreground_brush`](#function-foreground_brush)
- [`background_brush`](#function-background_brush)
- [`culture_info`](#function-culture_info)
- [`font_features`](#function-font_features)
- [`baseline_alignment`](#function-baseline_alignment)
- [`cached_glyph_typeface`](#function-cached_glyph_typeface)

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

### typeface

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

Run typeface.

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

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

### requested_font_family

```rust
fn requested_font_family(self: &Self) -> &FontFamily
```

The family requested by the source before glyph fallback. The family
metrics policy uses its regular face without changing the glyphs drawn.

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

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

### font_rendering_em_size

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

Font size requested by the source, before a fallback multiplier.

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

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

### font_scale

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

Provider fallback multiplier relative to the source em size. Existing
run implementations use one. Custom values must be finite and positive.

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

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

### effective_font_rendering_em_size

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

Effective em size for glyph shaping, drawing and font metrics. The
source's `font_rendering_em_size` remains unchanged by fallback.

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

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

### text_decorations

```rust
fn text_decorations(self: &Self) -> Option<&TextDecorationCollection>
```

Run text decorations.

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

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

### foreground_brush

```rust
fn foreground_brush(self: &Self) -> Option<&Rc<dyn IBrush>>
```

Brush used to fill text.

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

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

### background_brush

```rust
fn background_brush(self: &Self) -> Option<&Rc<dyn IBrush>>
```

Brush used to paint background of run.

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

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

### culture_info

```rust
fn culture_info(self: &Self) -> Option<&Locale>
```

Run text culture.

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

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

### font_features

```rust
fn font_features(self: &Self) -> Option<&FontFeatureCollection>
```

Optional features of used font.

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

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

### baseline_alignment

```rust
fn baseline_alignment(self: &Self) -> BaselineAlignment
```

Run vertical box alignment.

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

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

### cached_glyph_typeface

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

The glyph typeface of `TextRunProperties::typeface`.

Upstream caches it in a field of the base class; implementations that
are used for more than a handful of runs should do the same (as
`GenericTextRunProperties` does) and override this method.

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

## Trait implementations

- [`TextRunProperties`](/docs/0.5.0/api/ferroui-base/media/text_formatting/trait-textrunproperties/)

## Availability

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