# TextLayoutOptions

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

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

```rust
struct TextLayoutOptions
```

The optional parameters of `TextLayout::new`. `Default` gives upstream's
parameter defaults.

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

## Members

- [`font_size`](#struct_field-font_size)
- [`foreground`](#struct_field-foreground)
- [`text_alignment`](#struct_field-text_alignment)
- [`text_wrapping`](#struct_field-text_wrapping)
- [`text_trimming`](#struct_field-text_trimming)
- [`text_decorations`](#struct_field-text_decorations)
- [`flow_direction`](#struct_field-flow_direction)
- [`max_width`](#struct_field-max_width)
- [`max_height`](#struct_field-max_height)
- [`line_height`](#struct_field-line_height)
- [`letter_spacing`](#struct_field-letter_spacing)
- [`max_lines`](#struct_field-max_lines)
- [`font_features`](#struct_field-font_features)
- [`text_style_overrides`](#struct_field-text_style_overrides)
- [`text_run_cache`](#struct_field-text_run_cache)

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

### font_size

```rust
font_size: f64
```

Size of the font.

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

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

### foreground

```rust
foreground: Option<std::rc::Rc<dyn IBrush>>
```

The foreground.

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

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

### text_alignment

```rust
text_alignment: crate::media::TextAlignment
```

The text alignment.

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

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

### text_wrapping

```rust
text_wrapping: crate::media::TextWrapping
```

The text wrapping.

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

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

### text_trimming

```rust
text_trimming: Option<std::rc::Rc<dyn TextTrimming>>
```

The text trimming (`None` means no trimming).

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

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

### text_decorations

```rust
text_decorations: Option<crate::media::TextDecorationCollection>
```

The text decorations.

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

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

### flow_direction

```rust
flow_direction: crate::media::FlowDirection
```

The text flow direction.

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

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

### max_width

```rust
max_width: f64
```

The maximum width.

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

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

### max_height

```rust
max_height: f64
```

The maximum height.

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

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

### line_height

```rust
line_height: f64
```

The height of each line of text.

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

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

### letter_spacing

```rust
letter_spacing: f64
```

The letter spacing that is applied to rendered glyphs.

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

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

### max_lines

```rust
max_lines: i32
```

The maximum number of text lines.

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

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

### font_features

```rust
font_features: Option<crate::media::FontFeatureCollection>
```

Optional list of turned on/off features.

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

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

### text_style_overrides

```rust
text_style_overrides: Option<std::rc::Rc<[crate::utilities::ValueSpan<std::rc::Rc<dyn TextRunProperties>>]>>
```

The text style overrides.

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

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

### text_run_cache

```rust
text_run_cache: Option<std::rc::Rc<crate::media::text_formatting::TextRunCache>>
```

An optional cache for shaped text runs to avoid redundant shaping.

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

## 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`
- `Default`

## Availability

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