# PreparedTextMetrics

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-pretext-layout/struct-preparedtextmetrics/

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

```rust
struct PreparedTextMetrics
```

Sizing helpers that reuse preparation without constructing line strings.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/prepared_text_metrics.rs#L6)

## Members

- [`measure_max_line_width`](#function-measure_max_line_width)
- [`collect_wrap_metrics`](#function-collect_wrap_metrics)
- [`find_tight_wrap_metrics`](#function-find_tight_wrap_metrics)
- [`is_end`](#function-is_end)

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

### measure_max_line_width

```rust
fn measure_max_line_width(prepared: &PreparedTextWithSegments) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/prepared_text_metrics.rs#L9)

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

### collect_wrap_metrics

```rust
fn collect_wrap_metrics(prepared: &PreparedTextWithSegments, max_width: f64, line_height: f64) -> WrapMetrics
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/prepared_text_metrics.rs#L13)

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

### find_tight_wrap_metrics

```rust
fn find_tight_wrap_metrics(prepared: &PreparedTextWithSegments, max_width: f64, line_height: f64) -> Result<WrapMetrics, LayoutError>
```

Find the smallest integral width with no more lines than `max_width`.
Width is bounded to the exactly representable integer range of `f64` so
binary search makes strict progress, including very large user inputs.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/prepared_text_metrics.rs#L29)

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

### is_end

```rust
fn is_end(prepared: &PreparedTextWithSegments, cursor: LayoutCursor) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Pretext/FerroUI.Pretext.Layout/prepared_text_metrics.rs#L55)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

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