# FormattedTextSource

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

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

```rust
struct FormattedTextSource
```

The text source of a formatted text: one string with default properties
and optional property overrides for ranges of it.

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

## Members

- [`new`](#function-new)
- [`create_text_style_run`](#function-create_text_style_run)

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

### new

```rust
fn new(text: ReadOnlyMemory<u16>, default_properties: Rc<dyn TextRunProperties>, text_modifier: Option<Rc<[ValueSpan<Rc<dyn TextRunProperties>>]>>) -> Self
```



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

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

### create_text_style_run

```rust
fn create_text_style_run(text: &[u16], first_text_source_index: i32, default_properties: &Rc<dyn TextRunProperties>, text_modifier: Option<&[ValueSpan<Rc<dyn TextRunProperties>>]>) -> ValueSpan<Rc<dyn TextRunProperties>>
```

Creates a span of text run properties that has modifier applied.

* `text` — the text to create the properties for.
* `first_text_source_index` — the first text source index.
* `default_properties` — the default text properties.
* `text_modifier` — the text properties modifier.

Returns the created text style run.

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

## 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`
- [`ITextSource`](/docs/0.5.0/api/ferroui-base/media/text_formatting/trait-itextsource/)

## Availability

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