# ParagraphFormat

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/documents/struct-paragraphformat/

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

```rust
struct ParagraphFormat
```

Paragraph formatting and inherited character defaults, represented as a patch.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L314)

## Members

- [`character`](#struct_field-character)
- [`text_alignment`](#struct_field-text_alignment)
- [`line_height`](#struct_field-line_height)
- [`line_stacking_strategy`](#struct_field-line_stacking_strategy)
- [`text_indent`](#struct_field-text_indent)
- [`margin`](#struct_field-margin)
- [`flow_direction`](#struct_field-flow_direction)
- [`line_spacing_rule`](#struct_field-line_spacing_rule)
- [`line_spacing`](#struct_field-line_spacing)
- [`left_indent`](#struct_field-left_indent)
- [`right_indent`](#struct_field-right_indent)
- [`tab_stops`](#struct_field-tab_stops)
- [`default_tab_stop`](#struct_field-default_tab_stop)
- [`from_paragraph`](#function-from_paragraph)
- [`effective`](#function-effective)
- [`add_tab`](#function-add_tab)
- [`clear_all_tabs`](#function-clear_all_tabs)
- [`delete_tab`](#function-delete_tab)
- [`tab_count`](#function-tab_count)
- [`get_tab`](#function-get_tab)
- [`set_indents`](#function-set_indents)
- [`get_indents`](#function-get_indents)
- [`set_line_spacing`](#function-set_line_spacing)
- [`get_line_spacing`](#function-get_line_spacing)
- [`validate`](#function-validate)
- [`overlay`](#function-overlay)
- [`try_apply_to`](#function-try_apply_to)

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

### character

```rust
character: CharacterFormat
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L315)

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

### text_alignment

```rust
text_alignment: Option<ferroui_base::media::TextAlignment>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L316)

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

### line_height

```rust
line_height: Option<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L317)

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

### line_stacking_strategy

```rust
line_stacking_strategy: Option<super::LineStackingStrategy>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L318)

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

### text_indent

```rust
text_indent: Option<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L319)

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

### margin

```rust
margin: Option<ferroui_base::Thickness>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L320)

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

### flow_direction

```rust
flow_direction: Option<ferroui_base::media::FlowDirection>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L321)

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

### line_spacing_rule

```rust
line_spacing_rule: Option<super::LineSpacingRule>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L322)

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

### line_spacing

```rust
line_spacing: Option<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L323)

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

### left_indent

```rust
left_indent: Option<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L324)

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

### right_indent

```rust
right_indent: Option<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L325)

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

### tab_stops

```rust
tab_stops: Option<super::TextTabStops>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L326)

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

### default_tab_stop

```rust
default_tab_stop: Option<f64>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L327)

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

### from_paragraph

```rust
fn from_paragraph(paragraph: &Paragraph) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L349)

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

### effective

```rust
fn effective(paragraph: &Paragraph) -> Self
```

Captures resolved paragraph and inherited character values for format queries.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L369)

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

### add_tab

```rust
fn add_tab(self: &mut Self, position: f64, alignment: TabAlignment, leader: TabLeader) -> Result<(), super::DocumentError>
```

Adds or replaces an explicit tab. TOM positions are points; paragraph
properties, snapshots and the formatter retain layout units (96 per inch).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L389)

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

### clear_all_tabs

```rust
fn clear_all_tabs(self: &mut Self)
```

Removes explicit tabs; default equally spaced stops remain active.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L407)

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

### delete_tab

```rust
fn delete_tab(self: &mut Self, position: f64) -> Result<(), super::DocumentError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L411)

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

### tab_count

```rust
fn tab_count(self: &Self) -> usize
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L422)

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

### get_tab

```rust
fn get_tab(self: &Self, index: usize) -> Result<(f64, TabAlignment, TabLeader), super::DocumentError>
```

Zero-based explicit tab query; positions are returned in TOM points.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L427)

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

### set_indents

```rust
fn set_indents(self: &mut Self, first: f64, left: f64, right: f64) -> Result<(), super::DocumentError>
```

Sets TOM indentation in points. Negative values are valid; paragraph
margins remain nonnegative layout spacing and are stored separately.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L444)

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

### get_indents

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

Returns first-line, left, and right indentation in TOM points.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L463)

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

### set_line_spacing

```rust
fn set_line_spacing(self: &mut Self, rule: LineSpacingRule, spacing: f64) -> Result<(), super::DocumentError>
```

Sets the TOM line spacing in points, converting absolute distances to
layout units. Multipliers and percentages retain their native units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L473)

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

### get_line_spacing

```rust
fn get_line_spacing(self: &Self) -> (LineSpacingRule, f64)
```

Returns the TOM rule and value; absolute distances are returned in points.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L491)

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

### validate

```rust
fn validate(self: &Self) -> Result<(), super::DocumentError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L504)

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

### overlay

```rust
fn overlay(self: &Self, patch: &Self) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L551)

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

### try_apply_to

```rust
fn try_apply_to(self: &Self, paragraph: &Paragraph) -> Result<(), super::DocumentError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/character_format.rs#L576)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `Default`
- `PartialEq`

## Availability

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