# DrawableTextRun

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

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

```rust
trait DrawableTextRun: TextRun
```

A text run that supports drawing content.

Implementors also return `Some(self)` from `TextRun::as_drawable`.

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

## Members

- [`size`](#function-size)
- [`baseline`](#function-baseline)
- [`draw`](#function-draw)

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

### size

```rust
fn size(self: &Self) -> Size
```

Gets the size.

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

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

### baseline

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

Run baseline in ratio relative to run height.

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

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

### draw

```rust
fn draw(self: &Self, drawing_context: &mut dyn ITextDrawingSink, origin: Point)
```

Draws the run at the given origin.

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

## Trait implementations

- [`DrawableTextRun`](/docs/0.5.0/api/ferroui-base/media/text_formatting/trait-drawabletextrun/)

## Availability

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