# FontIcon

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

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

```rust
struct FontIcon
```

Represents an icon that uses a glyph of a font as its content (WinUI's `FontIcon`).

The template of the theme draws `glyph` in its text part `PART_Text` with the
font family, size, style, weight and foreground of the icon. The size is 20 by default, as in
WinUI; the font family is the theme resource `SymbolThemeFontFamily` (Segoe Fluent Icons in the
WinUI theme), set by the theme, where WinUI takes it from the default font of a font icon. The
font is not bundled: off Windows an application supplies a symbol font and sets
`SymbolThemeFontFamily` or the icon's `FontFamily` (docs/porting/winui-controls.md, section
5.2). The WinUI theme has the template; the Fluent and Simple themes have none.

Missing (docs/porting/winui-controls.md, FontIcon): `IsTextScaleFactorEnabled` (FerroUI has no
text scale factor).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`glyph_property`](#function-glyph_property)
- [`mirrored_when_right_to_left_property`](#function-mirrored_when_right_to_left_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`glyph`](#function-glyph)
- [`set_glyph`](#function-set_glyph)
- [`mirrored_when_right_to_left`](#function-mirrored_when_right_to_left)
- [`set_mirrored_when_right_to_left`](#function-set_mirrored_when_right_to_left)

<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/font_icon.rs#L35)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### glyph_property

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

Defines the `Glyph` property: the text drawn with the icon font, one glyph or more.

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

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

### mirrored_when_right_to_left_property

```rust
fn mirrored_when_right_to_left_property() -> &'static StyledProperty<bool>
```

Defines the `MirroredWhenRightToLeft` property: whether the glyph is mirrored when the
flow direction is right to left. `false` by default.

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

<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/font_icon.rs#L112)

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

### new

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



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

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

### glyph

```rust
fn glyph(self: &Self) -> String
```

Gets the text drawn with the icon font.

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

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

### set_glyph

```rust
fn set_glyph(self: &Self, value: impl Into<String>)
```

Sets the text drawn with the icon font.

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

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

### mirrored_when_right_to_left

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

Gets whether the glyph is mirrored when the flow direction is right to left.

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

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

### set_mirrored_when_right_to_left

```rust
fn set_mirrored_when_right_to_left(self: &Self, value: bool)
```

Sets whether the glyph is mirrored when the flow direction is right to left.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `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<FontIcon>`](/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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)

## Availability

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