# Codepoint

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

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

```rust
struct Codepoint
```

A Unicode code point (not necessarily a scalar value: lone surrogates and
values above U+10FFFF can be represented, as upstream).

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

## Members

- [`REPLACEMENT_CODEPOINT`](#assoc_const-replacement_codepoint)
- [`replacement_codepoint`](#function-replacement_codepoint)
- [`new`](#function-new)
- [`value`](#function-value)
- [`general_category`](#function-general_category)
- [`script`](#function-script)
- [`bi_di_class`](#function-bi_di_class)
- [`paired_bracket_type`](#function-paired_bracket_type)
- [`line_break_class`](#function-line_break_class)
- [`word_break_class`](#function-word_break_class)
- [`sentence_break_class`](#function-sentence_break_class)
- [`grapheme_break_class`](#function-grapheme_break_class)
- [`east_asian_width_class`](#function-east_asian_width_class)
- [`is_emoji`](#function-is_emoji)
- [`has_emoji_presentation`](#function-has_emoji_presentation)
- [`is_default_ignorable`](#function-is_default_ignorable)
- [`has_script_extension`](#function-has_script_extension)
- [`is_east_asian`](#function-is_east_asian)
- [`is_break_char`](#function-is_break_char)
- [`is_white_space`](#function-is_white_space)
- [`try_get_paired_bracket`](#function-try_get_paired_bracket)
- [`read_at`](#function-read_at)
- [`is_in_range_inclusive`](#function-is_in_range_inclusive)

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

### REPLACEMENT_CODEPOINT

```rust
const REPLACEMENT_CODEPOINT: Codepoint
```

The replacement codepoint that is used for non supported values.

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

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

### replacement_codepoint

```rust
const fn replacement_codepoint() -> Codepoint
```

The replacement codepoint that is used for non supported values.

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

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

### new

```rust
const fn new(value: u32) -> Self
```

Creates a new instance of `Codepoint` with the specified value.

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

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

### value

```rust
const fn value(self: Self) -> u32
```

Get the codepoint's value.

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

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

### general_category

```rust
fn general_category(self: Self) -> GeneralCategory
```

Gets the `GeneralCategory`.

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

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

### script

```rust
fn script(self: Self) -> Script
```

Gets the `Script`.

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

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

### bi_di_class

```rust
fn bi_di_class(self: Self) -> BidiClass
```

Gets the `BidiClass`.

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

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

### paired_bracket_type

```rust
fn paired_bracket_type(self: Self) -> BidiPairedBracketType
```

Gets the `BidiPairedBracketType`.

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

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

### line_break_class

```rust
fn line_break_class(self: Self) -> LineBreakClass
```

Gets the `LineBreakClass`.

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

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

### word_break_class

```rust
fn word_break_class(self: Self) -> WordBreakClass
```

Gets the `WordBreakClass`.

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

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

### sentence_break_class

```rust
fn sentence_break_class(self: Self) -> SentenceBreakClass
```

Gets the `SentenceBreakClass` (UAX #29).

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

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

### grapheme_break_class

```rust
fn grapheme_break_class(self: Self) -> GraphemeBreakClass
```

Gets the `GraphemeBreakClass`.

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

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

### east_asian_width_class

```rust
fn east_asian_width_class(self: Self) -> EastAsianWidthClass
```

Gets the `EastAsianWidthClass`.

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

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

### is_emoji

```rust
fn is_emoji(self: Self) -> bool
```

Determines whether this `Codepoint` has the Unicode `Emoji` property.

The property marks a codepoint that can be presented as emoji; it says nothing about which
presentation is the default. Use `Codepoint::has_emoji_presentation` for that.

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

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

### has_emoji_presentation

```rust
fn has_emoji_presentation(self: Self) -> bool
```

Determines whether this `Codepoint` has the Unicode `Emoji_Presentation`
property, i.e. whether it defaults to an emoji presentation when no variation selector
follows it.

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

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

### is_default_ignorable

```rust
fn is_default_ignorable(self: Self) -> bool
```

Determines whether this `Codepoint` has the Unicode
`Default_Ignorable_Code_Point` property.

Default ignorable codepoints (variation selectors, joiners, the byte order mark, ...) are
meant to have no visible rendering of their own, so a font is not expected to provide a
glyph for them.

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

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

### has_script_extension

```rust
fn has_script_extension(self: Self, script: Script) -> bool
```

Determines whether the codepoint's Unicode Script_Extensions property contains
`script`.

Returns `true` when the codepoint participates in `script` per UAX #24
(Script_Extensions); `false` otherwise.

Backed by the UCD `ScriptExtensions.txt` data baked into `UnicodeData`.
Codepoints without an explicit Script_Extensions entry fall back to the singleton set
of their primary `Script` property.

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

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

### is_east_asian

```rust
fn is_east_asian(self: Self) -> bool
```

Determines whether this `Codepoint` is an east asian char.

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

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

### is_break_char

```rust
const fn is_break_char(self: Self) -> bool
```

Determines whether this `Codepoint` is a break char.

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

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

### is_white_space

```rust
fn is_white_space(self: Self) -> bool
```

Determines whether this `Codepoint` is white space.

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

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

### try_get_paired_bracket

```rust
fn try_get_paired_bracket(self: Self) -> Option<Codepoint>
```

Gets the codepoint representing the bracket pairing for this instance,
or `None` if this instance has no bracket pairing.

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

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

### read_at

```rust
fn read_at(text: &[u16], index: usize) -> (Codepoint, usize)
```

Reads the `Codepoint` at specified position.

Returns the codepoint and the count of code units that were read
(always 1 or 2; an index outside of the text or an unpaired surrogate
yields the replacement codepoint and a count of 1).

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

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

### is_in_range_inclusive

```rust
const fn is_in_range_inclusive(cp: Codepoint, lower_bound: u32, upper_bound: u32) -> bool
```

Returns `true` if `cp` is between `lower_bound` and `upper_bound`, inclusive.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`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`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `Debug`
- `Default`
- `From<Codepoint>`

## Availability

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