# TextBlock

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

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

```rust
struct TextBlock
```

A control that displays a block of text.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`render_text_layout`](#function-render_text_layout)
- [`create_text_layout`](#function-create_text_layout)
- [`background_property`](#function-background_property)
- [`padding_property`](#function-padding_property)
- [`font_family_property`](#function-font_family_property)
- [`font_size_property`](#function-font_size_property)
- [`font_style_property`](#function-font_style_property)
- [`font_weight_property`](#function-font_weight_property)
- [`font_stretch_property`](#function-font_stretch_property)
- [`foreground_property`](#function-foreground_property)
- [`baseline_offset_property`](#function-baseline_offset_property)
- [`text_line_bounds_property`](#function-text_line_bounds_property)
- [`layout_rounding_placement_property`](#function-layout_rounding_placement_property)
- [`line_height_property`](#function-line_height_property)
- [`line_spacing_property`](#function-line_spacing_property)
- [`letter_spacing_property`](#function-letter_spacing_property)
- [`max_lines_property`](#function-max_lines_property)
- [`text_property`](#function-text_property)
- [`text_alignment_property`](#function-text_alignment_property)
- [`text_wrapping_property`](#function-text_wrapping_property)
- [`text_trimming_property`](#function-text_trimming_property)
- [`text_decorations_property`](#function-text_decorations_property)
- [`font_features_property`](#function-font_features_property)
- [`inlines_property`](#function-inlines_property)
- [`construct`](#function-construct)
- [`get_alpha_mask`](#function-get_alpha_mask)
- [`new`](#function-new)
- [`text_layout`](#function-text_layout)
- [`padding`](#function-padding)
- [`set_padding`](#function-set_padding)
- [`background`](#function-background)
- [`set_background`](#function-set_background)
- [`text`](#function-text)
- [`set_text`](#function-set_text)
- [`font_family`](#function-font_family)
- [`set_font_family`](#function-set_font_family)
- [`font_size`](#function-font_size)
- [`set_font_size`](#function-set_font_size)
- [`font_style`](#function-font_style)
- [`set_font_style`](#function-set_font_style)
- [`font_weight`](#function-font_weight)
- [`set_font_weight`](#function-set_font_weight)
- [`font_stretch`](#function-font_stretch)
- [`set_font_stretch`](#function-set_font_stretch)
- [`foreground`](#function-foreground)
- [`set_foreground`](#function-set_foreground)
- [`line_height`](#function-line_height)
- [`set_line_height`](#function-set_line_height)
- [`line_spacing`](#function-line_spacing)
- [`set_line_spacing`](#function-set_line_spacing)
- [`letter_spacing`](#function-letter_spacing)
- [`set_letter_spacing`](#function-set_letter_spacing)
- [`max_lines`](#function-max_lines)
- [`set_max_lines`](#function-set_max_lines)
- [`text_wrapping`](#function-text_wrapping)
- [`set_text_wrapping`](#function-set_text_wrapping)
- [`text_trimming`](#function-text_trimming)
- [`set_text_trimming`](#function-set_text_trimming)
- [`text_alignment`](#function-text_alignment)
- [`set_text_alignment`](#function-set_text_alignment)
- [`text_decorations`](#function-text_decorations)
- [`set_text_decorations`](#function-set_text_decorations)
- [`font_features`](#function-font_features)
- [`set_font_features`](#function-set_font_features)
- [`inlines`](#function-inlines)
- [`set_inlines`](#function-set_inlines)
- [`has_complex_content`](#function-has_complex_content)
- [`get_max_size_from_constraint`](#function-get_max_size_from_constraint)
- [`constraint`](#function-constraint)
- [`text_runs`](#function-text_runs)
- [`baseline_offset`](#function-baseline_offset)
- [`set_baseline_offset`](#function-set_baseline_offset)
- [`get_baseline_offset`](#function-get_baseline_offset)
- [`set_baseline_offset_on`](#function-set_baseline_offset_on)
- [`text_line_bounds`](#function-text_line_bounds)
- [`set_text_line_bounds`](#function-set_text_line_bounds)
- [`get_text_line_bounds`](#function-get_text_line_bounds)
- [`set_text_line_bounds_on`](#function-set_text_line_bounds_on)
- [`layout_rounding_placement`](#function-layout_rounding_placement)
- [`set_layout_rounding_placement`](#function-set_layout_rounding_placement)
- [`get_layout_rounding_placement`](#function-get_layout_rounding_placement)
- [`set_layout_rounding_placement_on`](#function-set_layout_rounding_placement_on)
- [`layout_rounding_offset`](#function-layout_rounding_offset)
- [`get_text_alignment`](#function-get_text_alignment)
- [`set_text_alignment_on`](#function-set_text_alignment_on)
- [`get_text_wrapping`](#function-get_text_wrapping)
- [`set_text_wrapping_on`](#function-set_text_wrapping_on)
- [`get_text_trimming`](#function-get_text_trimming)
- [`set_text_trimming_on`](#function-set_text_trimming_on)
- [`get_line_height`](#function-get_line_height)
- [`set_line_height_on`](#function-set_line_height_on)
- [`get_letter_spacing`](#function-get_letter_spacing)
- [`set_letter_spacing_on`](#function-set_letter_spacing_on)
- [`get_max_lines`](#function-get_max_lines)
- [`set_max_lines_on`](#function-set_max_lines_on)
- [`invalidate_text_layout`](#function-invalidate_text_layout)
- [`ensure_text_runs`](#function-ensure_text_runs)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L66)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<TextBlock>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L66)

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

### render_text_layout

```rust
fn render_text_layout(self: &Self, context: &mut DrawingContext<'_>, origin: Point)
```

Renders the text layout to a drawing context.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L66)

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

### create_text_layout

```rust
fn create_text_layout(self: &Self, text: Option<&str>) -> Rc<TextLayout>
```

Creates the `TextLayout` used to render the text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L66)

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

### background_property

```rust
fn background_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```

Defines the `Background` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### padding_property

```rust
fn padding_property() -> &'static StyledProperty<Thickness>
```

Defines the `Padding` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### font_family_property

```rust
fn font_family_property() -> &'static StyledProperty<FontFamily>
```

Defines the `FontFamily` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### font_size_property

```rust
fn font_size_property() -> &'static StyledProperty<f64>
```

Defines the `FontSize` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### font_style_property

```rust
fn font_style_property() -> &'static StyledProperty<FontStyle>
```

Defines the `FontStyle` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### font_weight_property

```rust
fn font_weight_property() -> &'static StyledProperty<FontWeight>
```

Defines the `FontWeight` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### font_stretch_property

```rust
fn font_stretch_property() -> &'static StyledProperty<FontStretch>
```

Defines the `FontStretch` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### foreground_property

```rust
fn foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```

Defines the `Foreground` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### baseline_offset_property

```rust
fn baseline_offset_property() -> &'static AttachedProperty<f64>
```

Defines the `BaselineOffset` attached property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### text_line_bounds_property

```rust
fn text_line_bounds_property() -> &'static AttachedProperty<TextLineBounds>
```

Defines the `TextLineBounds` attached property: how the box of each line is bounded
above and below (a FerroUI addition after WinUI's `TextBlock.TextLineBounds`,
DEVIATIONS.md, Text block). Inherited, as the other attached text properties, so that
a content presenter sets it for the text of its content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### layout_rounding_placement_property

```rust
fn layout_rounding_placement_property() -> &'static AttachedProperty<TextLayoutRoundingPlacement>
```

Defines the `LayoutRoundingPlacement` attached property: where a text block puts
the height layout rounding adds to it (a FerroUI addition). Inherited, so that a
theme sets it once on the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### line_height_property

```rust
fn line_height_property() -> &'static AttachedProperty<f64>
```

Defines the `LineHeight` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### line_spacing_property

```rust
fn line_spacing_property() -> &'static AttachedProperty<f64>
```

Defines the `LineSpacing` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### letter_spacing_property

```rust
fn letter_spacing_property() -> &'static StyledProperty<f64>
```

Defines the `LetterSpacing` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### max_lines_property

```rust
fn max_lines_property() -> &'static AttachedProperty<i32>
```

Defines the `MaxLines` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### text_property

```rust
fn text_property() -> &'static StyledProperty<Option<String>>
```

Defines the `Text` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### text_alignment_property

```rust
fn text_alignment_property() -> &'static AttachedProperty<TextAlignment>
```

Defines the `TextAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### text_wrapping_property

```rust
fn text_wrapping_property() -> &'static AttachedProperty<TextWrapping>
```

Defines the `TextWrapping` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### text_trimming_property

```rust
fn text_trimming_property() -> &'static AttachedProperty<Rc<dyn TextTrimming>>
```

Defines the `TextTrimming` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### text_decorations_property

```rust
fn text_decorations_property() -> &'static StyledProperty<Option<TextDecorationCollection>>
```

Defines the `TextDecorations` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### font_features_property

```rust
fn font_features_property() -> &'static StyledProperty<Option<FontFeatureCollection>>
```

Defines the `FontFeatures` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### inlines_property

```rust
fn inlines_property() -> &'static DirectProperty<TextBlock, Option<InlineCollection>>
```

Defines the `Inlines` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L470)

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L681)

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

### get_alpha_mask

```rust
fn get_alpha_mask(self: &Self) -> Option<Rc<ferroui_base::rendering::composition::CompositionBrush>>
```

`TextBlock.GetAlphaMask`: a composition brush that shows the alpha of
the text block (its text, and its background when it has one), for
the `Mask` of a
`DropShadow` or
another composition effect. The same brush is returned on every call;
it follows the text block as it is drawn again (its text, font, size
and visibility). `None` when no compositor is available.

See `AlphaMask` for
how the mask is drawn.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L746)

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

### new

```rust
fn new() -> Ref<Self>
```

Initializes a new instance of the `TextBlock` class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L753)

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

### text_layout

```rust
fn text_layout(self: &Self) -> Rc<TextLayout>
```

The `TextLayout` used to render the text.

The layout is cached until a property it depends on, the measure of
the control or its constraint changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L761)

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

### padding

```rust
fn padding(self: &Self) -> Thickness
```

The padding to place around the `Text`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L810)

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

### set_padding

```rust
fn set_padding(self: &Self, value: Thickness)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L814)

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

### background

```rust
fn background(self: &Self) -> Option<Rc<dyn IBrush>>
```

A brush used to paint the control's background.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L819)

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

### set_background

```rust
fn set_background(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L823)

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

### text

```rust
fn text(self: &Self) -> Option<String>
```

The text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L828)

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

### set_text

```rust
fn set_text(self: &Self, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L832)

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

### font_family

```rust
fn font_family(self: &Self) -> FontFamily
```

The font family used to draw the control's text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L837)

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

### set_font_family

```rust
fn set_font_family(self: &Self, value: FontFamily)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L841)

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

### font_size

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

The size of the control's text in points.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L846)

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

### set_font_size

```rust
fn set_font_size(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L850)

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

### font_style

```rust
fn font_style(self: &Self) -> FontStyle
```

The font style used to draw the control's text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L855)

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

### set_font_style

```rust
fn set_font_style(self: &Self, value: FontStyle)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L859)

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

### font_weight

```rust
fn font_weight(self: &Self) -> FontWeight
```

The font weight used to draw the control's text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L864)

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

### set_font_weight

```rust
fn set_font_weight(self: &Self, value: FontWeight)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L868)

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

### font_stretch

```rust
fn font_stretch(self: &Self) -> FontStretch
```

The font stretch used to draw the control's text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L873)

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

### set_font_stretch

```rust
fn set_font_stretch(self: &Self, value: FontStretch)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L877)

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

### foreground

```rust
fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
```

The brush used to draw the control's text and other foreground
elements.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L883)

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

### set_foreground

```rust
fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L887)

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

### line_height

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

The height of each line of content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L892)

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

### set_line_height

```rust
fn set_line_height(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L896)

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

### line_spacing

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

The extra distance between each line of content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L901)

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

### set_line_spacing

```rust
fn set_line_spacing(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L905)

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

### letter_spacing

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

The letter spacing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L910)

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

### set_letter_spacing

```rust
fn set_letter_spacing(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L914)

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

### max_lines

```rust
fn max_lines(self: &Self) -> i32
```

The maximum number of text lines.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L919)

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

### set_max_lines

```rust
fn set_max_lines(self: &Self, value: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L923)

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

### text_wrapping

```rust
fn text_wrapping(self: &Self) -> TextWrapping
```

The control's text wrapping mode.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L928)

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

### set_text_wrapping

```rust
fn set_text_wrapping(self: &Self, value: TextWrapping)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L932)

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

### text_trimming

```rust
fn text_trimming(self: &Self) -> Rc<dyn TextTrimming>
```

The control's text trimming mode.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L937)

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

### set_text_trimming

```rust
fn set_text_trimming(self: &Self, value: Rc<dyn TextTrimming>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L941)

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

### text_alignment

```rust
fn text_alignment(self: &Self) -> TextAlignment
```

The text alignment.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L946)

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

### set_text_alignment

```rust
fn set_text_alignment(self: &Self, value: TextAlignment)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L950)

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

### text_decorations

```rust
fn text_decorations(self: &Self) -> Option<TextDecorationCollection>
```

The text decorations.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L955)

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

### set_text_decorations

```rust
fn set_text_decorations(self: &Self, value: Option<TextDecorationCollection>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L959)

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

### font_features

```rust
fn font_features(self: &Self) -> Option<FontFeatureCollection>
```

The font features.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L964)

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

### set_font_features

```rust
fn set_font_features(self: &Self, value: Option<FontFeatureCollection>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L968)

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

### inlines

```rust
fn inlines(self: &Self) -> Option<InlineCollection>
```

The inlines.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L973)

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

### set_inlines

```rust
fn set_inlines(self: &Self, value: Option<InlineCollection>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L983)

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

### has_complex_content

```rust
fn has_complex_content(self: &Self) -> bool
```

Whether the text block displays inlines rather than its `Text`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L992)

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

### get_max_size_from_constraint

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

The constraint of the text layout as a maximum size: an unset
constraint is zero.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L998)

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

### constraint

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

The constraint the text layout is created for.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1006)

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

### text_runs

```rust
fn text_runs(self: &Self) -> Option<Rc<Vec<Rc<dyn TextRun>>>>
```

The text runs of the inlines, when they have been built.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1011)

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

### baseline_offset

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

The baseline offset.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1016)

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

### set_baseline_offset

```rust
fn set_baseline_offset(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1020)

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

### get_baseline_offset

```rust
fn get_baseline_offset(control: &Control) -> f64
```

Reads the attached `BaselineOffset` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1025)

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

### set_baseline_offset_on

```rust
fn set_baseline_offset_on(control: &Control, value: f64)
```

Writes the attached `BaselineOffset` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1030)

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

### text_line_bounds

```rust
fn text_line_bounds(self: &Self) -> TextLineBounds
```

How the box of each line is bounded: by the ascent and the descent of the font (the
default), or trimmed to the cap height above the baseline, to the baseline below it, or
both. A FerroUI addition after WinUI's `TextLineBounds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1037)

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

### set_text_line_bounds

```rust
fn set_text_line_bounds(self: &Self, value: TextLineBounds)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1041)

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

### get_text_line_bounds

```rust
fn get_text_line_bounds(control: &Control) -> TextLineBounds
```

Reads the attached `TextLineBounds` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1046)

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

### set_text_line_bounds_on

```rust
fn set_text_line_bounds_on(control: &Control, value: TextLineBounds)
```

Writes the attached `TextLineBounds` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1051)

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

### layout_rounding_placement

```rust
fn layout_rounding_placement(self: &Self) -> TextLayoutRoundingPlacement
```

Where the text block puts the height layout rounding adds to it: below its text (the
default, as the reference) or above it (as WinUI). A FerroUI addition.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1057)

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

### set_layout_rounding_placement

```rust
fn set_layout_rounding_placement(self: &Self, value: TextLayoutRoundingPlacement)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1061)

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

### get_layout_rounding_placement

```rust
fn get_layout_rounding_placement(control: &Control) -> TextLayoutRoundingPlacement
```

Reads the attached `LayoutRoundingPlacement` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1066)

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

### set_layout_rounding_placement_on

```rust
fn set_layout_rounding_placement_on(control: &Control, value: TextLayoutRoundingPlacement)
```

Writes the attached `LayoutRoundingPlacement` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1071)

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

### layout_rounding_offset

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

How far down the text is drawn from the top of the content (the top padding) because
layout rounding added height to the block: the height of the text and the vertical
padding rounded up to whole device pixels, minus that height, when
`layout_rounding_placement` is
`Above` and the block uses layout rounding; zero
otherwise. Rendering, hit testing and the access key underline add it to the top padding
(WinUI's `CTextBlock::GetContentRenderingOffset`). A FerroUI addition.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1082)

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

### get_text_alignment

```rust
fn get_text_alignment(control: &Control) -> TextAlignment
```

Reads the attached `TextAlignment` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1105)

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

### set_text_alignment_on

```rust
fn set_text_alignment_on(control: &Control, alignment: TextAlignment)
```

Writes the attached `TextAlignment` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1110)

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

### get_text_wrapping

```rust
fn get_text_wrapping(control: &Control) -> TextWrapping
```

Reads the attached `TextWrapping` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1115)

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

### set_text_wrapping_on

```rust
fn set_text_wrapping_on(control: &Control, wrapping: TextWrapping)
```

Writes the attached `TextWrapping` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1120)

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

### get_text_trimming

```rust
fn get_text_trimming(control: &Control) -> Rc<dyn TextTrimming>
```

Reads the attached `TextTrimming` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1125)

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

### set_text_trimming_on

```rust
fn set_text_trimming_on(control: &Control, trimming: Rc<dyn TextTrimming>)
```

Writes the attached `TextTrimming` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1130)

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

### get_line_height

```rust
fn get_line_height(control: &Control) -> f64
```

Reads the attached `LineHeight` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1135)

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

### set_line_height_on

```rust
fn set_line_height_on(control: &Control, height: f64)
```

Writes the attached `LineHeight` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1140)

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

### get_letter_spacing

```rust
fn get_letter_spacing(control: &Control) -> f64
```

Reads the attached `LetterSpacing` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1145)

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

### set_letter_spacing_on

```rust
fn set_letter_spacing_on(control: &Control, letter_spacing: f64)
```

Writes the attached `LetterSpacing` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1150)

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

### get_max_lines

```rust
fn get_max_lines(control: &Control) -> i32
```

Reads the attached `MaxLines` property from the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1155)

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

### set_max_lines_on

```rust
fn set_max_lines_on(control: &Control, max_lines: i32)
```

Writes the attached `MaxLines` property to the given control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1160)

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

### invalidate_text_layout

```rust
fn invalidate_text_layout(self: &Self)
```

Invalidates the text layout and the shaped runs it was built from.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1232)

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

### ensure_text_runs

```rust
fn ensure_text_runs(self: &Self)
```

Builds the text runs of the inlines, unless they are up to date.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/text_block.rs#L1361)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`TextBlockImplExt`](/docs/0.5.0/api/ferroui-controls/trait-textblockimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TextBlock>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- `Drop`
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`TextBlockImpl`](/docs/0.5.0/api/ferroui-controls/trait-textblockimpl/)

## Availability

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