# Grapheme

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

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

```rust
struct Grapheme
```

Represents the smallest unit of a writing system of any given language.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/unicode/grapheme.rs#L5)

## Members

- [`new`](#function-new)
- [`first_codepoint`](#function-first_codepoint)
- [`offset`](#function-offset)
- [`length`](#function-length)

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

### new

```rust
const fn new(first_codepoint: Codepoint, offset: usize, length: usize) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/unicode/grapheme.rs#L13)

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

### first_codepoint

```rust
const fn first_codepoint(self: &Self) -> Codepoint
```

The first `Codepoint` of the grapheme cluster.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/unicode/grapheme.rs#L19)

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

### offset

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

Gets the starting code unit offset of this grapheme inside its containing text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/unicode/grapheme.rs#L25)

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

### length

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

Gets the length of this grapheme, in code units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/unicode/grapheme.rs#L31)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`

## Availability

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