# TextDecoration

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-textdecoration/

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

```rust
struct TextDecoration
```

Represents a text decoration, which is a visual ornamentation that is
added to text (such as an underline).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`location_property`](#function-location_property)
- [`stroke_property`](#function-stroke_property)
- [`stroke_thickness_unit_property`](#function-stroke_thickness_unit_property)
- [`stroke_dash_array_property`](#function-stroke_dash_array_property)
- [`stroke_dash_offset_property`](#function-stroke_dash_offset_property)
- [`stroke_thickness_property`](#function-stroke_thickness_property)
- [`stroke_line_cap_property`](#function-stroke_line_cap_property)
- [`stroke_offset_property`](#function-stroke_offset_property)
- [`stroke_offset_unit_property`](#function-stroke_offset_unit_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`location`](#function-location)
- [`set_location`](#function-set_location)
- [`stroke`](#function-stroke)
- [`set_stroke`](#function-set_stroke)
- [`stroke_thickness_unit`](#function-stroke_thickness_unit)
- [`set_stroke_thickness_unit`](#function-set_stroke_thickness_unit)
- [`stroke_dash_array`](#function-stroke_dash_array)
- [`set_stroke_dash_array`](#function-set_stroke_dash_array)
- [`stroke_dash_offset`](#function-stroke_dash_offset)
- [`set_stroke_dash_offset`](#function-set_stroke_dash_offset)
- [`stroke_thickness`](#function-stroke_thickness)
- [`set_stroke_thickness`](#function-set_stroke_thickness)
- [`stroke_line_cap`](#function-stroke_line_cap)
- [`set_stroke_line_cap`](#function-set_stroke_line_cap)
- [`stroke_offset`](#function-stroke_offset)
- [`set_stroke_offset`](#function-set_stroke_offset)
- [`stroke_offset_unit`](#function-stroke_offset_unit)
- [`set_stroke_offset_unit`](#function-set_stroke_offset_unit)

<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.Base/media/text_decoration.rs#L20)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### location_property

```rust
fn location_property() -> &'static StyledProperty<TextDecorationLocation>
```

Defines the `Location` property.

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

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

### stroke_property

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

Defines the `Stroke` property.

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

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

### stroke_thickness_unit_property

```rust
fn stroke_thickness_unit_property() -> &'static StyledProperty<TextDecorationUnit>
```

Defines the `StrokeThicknessUnit` property.

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

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

### stroke_dash_array_property

```rust
fn stroke_dash_array_property() -> &'static StyledProperty<Option<MediaCollection<f64>>>
```

Defines the `StrokeDashArray` property.

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

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

### stroke_dash_offset_property

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

Defines the `StrokeDashOffset` property.

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

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

### stroke_thickness_property

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

Defines the `StrokeThickness` property.

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

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

### stroke_line_cap_property

```rust
fn stroke_line_cap_property() -> &'static StyledProperty<PenLineCap>
```

Defines the `StrokeLineCap` property.

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

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

### stroke_offset_property

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

Defines the `StrokeOffset` property.

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

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

### stroke_offset_unit_property

```rust
fn stroke_offset_unit_property() -> &'static StyledProperty<TextDecorationUnit>
```

Defines the `StrokeOffsetUnit` property.

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

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

### construct

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

Creates the class data.

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

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

### new

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

Creates a text decoration with default values (an underline).

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

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

### location

```rust
fn location(self: &Self) -> TextDecorationLocation
```

Gets the location.

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

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

### set_location

```rust
fn set_location(self: &Self, value: TextDecorationLocation)
```

Sets the location.

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

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

### stroke

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

Gets the brush that specifies how the text decoration is painted.

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

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

### set_stroke

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

Sets the brush that specifies how the text decoration is painted.

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

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

### stroke_thickness_unit

```rust
fn stroke_thickness_unit(self: &Self) -> TextDecorationUnit
```

Gets the units in which the thickness of the text decoration is expressed.

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

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

### set_stroke_thickness_unit

```rust
fn set_stroke_thickness_unit(self: &Self, value: TextDecorationUnit)
```

Sets the units in which the thickness of the text decoration is expressed.

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

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

### stroke_dash_array

```rust
fn stroke_dash_array(self: &Self) -> Option<MediaCollection<f64>>
```

Gets a collection of values that indicate the pattern of dashes and
gaps that is used to draw the text decoration.

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

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

### set_stroke_dash_array

```rust
fn set_stroke_dash_array(self: &Self, value: Option<MediaCollection<f64>>)
```

Sets a collection of values that indicate the pattern of dashes and
gaps that is used to draw the text decoration.

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

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

### stroke_dash_offset

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

Gets a value that specifies the distance within the dash pattern where a dash begins.

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

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

### set_stroke_dash_offset

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

Sets a value that specifies the distance within the dash pattern where a dash begins.

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

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

### stroke_thickness

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

Gets the thickness of the text decoration.

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

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

### set_stroke_thickness

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

Sets the thickness of the text decoration.

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

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

### stroke_line_cap

```rust
fn stroke_line_cap(self: &Self) -> PenLineCap
```

Gets a value that describes the shape at the ends of a line.

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

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

### set_stroke_line_cap

```rust
fn set_stroke_line_cap(self: &Self, value: PenLineCap)
```

Sets a value that describes the shape at the ends of a line.

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

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

### stroke_offset

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

The stroke's offset.

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

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

### set_stroke_offset

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

Sets the stroke's offset.

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

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

### stroke_offset_unit

```rust
fn stroke_offset_unit(self: &Self) -> TextDecorationUnit
```

Gets the units in which the offset value is expressed.

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

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

### set_stroke_offset_unit

```rust
fn set_stroke_offset_unit(self: &Self, value: TextDecorationUnit)
```

Sets the units in which the offset value is expressed.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `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`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TextDecoration>`](/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/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

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