# FerroTextService

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-pretext-media/struct-ferrotextservice/

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

```rust
struct FerroTextService
```

A fixed-font native measurement and glyph-shaping service.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Media/ferro_text_measurer_factory.rs#L230)

## Members

- [`try_measure_text`](#function-try_measure_text)
- [`shape_native`](#function-shape_native)

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

### try_measure_text

```rust
fn try_measure_text(self: &Self, text: &str) -> Result<f64, PretextError>
```

Measures with the same shaping and font fallback as native drawing,
without allocating portable glyph records or drawing resources.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Media/ferro_text_measurer_factory.rs#L243)

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

### shape_native

```rust
fn shape_native(self: &Self, text: &str, options: PretextShapeOptions) -> Result<FerroShapedText, PretextError>
```

Shapes through the framework's Unicode bidi, font fallback and platform
shaping services and retains the actual native font faces for drawing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Media/ferro_text_measurer_factory.rs#L264)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`IPretextTextMeasurer`](/docs/0.5.0/api/ferroui-pretext-contracts/trait-ipretexttextmeasurer/)
- [`IPretextTextShaper`](/docs/0.5.0/api/ferroui-pretext-contracts/trait-ipretexttextshaper/)

## Availability

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