Codepoint
struct · ferroui-base · v0.5.0
struct Codepoint
A Unicode code point (not necessarily a scalar value: lone surrogates and values above U+10FFFF can be represented, as upstream).
Members
REPLACEMENT_CODEPOINTreplacement_codepointnewvaluegeneral_categoryscriptbi_di_classpaired_bracket_typeline_break_classword_break_classsentence_break_classgrapheme_break_classeast_asian_width_classis_emojihas_emoji_presentationis_default_ignorablehas_script_extensionis_east_asianis_break_charis_white_spacetry_get_paired_bracketread_atis_in_range_inclusive
REPLACEMENT_CODEPOINT
const REPLACEMENT_CODEPOINT: Codepoint
The replacement codepoint that is used for non supported values.
replacement_codepoint
const fn replacement_codepoint() -> Codepoint
The replacement codepoint that is used for non supported values.
new
const fn new(value: u32) -> Self
Creates a new instance of Codepoint with the specified value.
value
const fn value(self: Self) -> u32
Get the codepoint's value.
general_category
fn general_category(self: Self) -> GeneralCategory
Gets the GeneralCategory.
script
fn script(self: Self) -> Script
Gets the Script.
bi_di_class
fn bi_di_class(self: Self) -> BidiClass
Gets the BidiClass.
paired_bracket_type
fn paired_bracket_type(self: Self) -> BidiPairedBracketType
Gets the BidiPairedBracketType.
line_break_class
fn line_break_class(self: Self) -> LineBreakClass
Gets the LineBreakClass.
word_break_class
fn word_break_class(self: Self) -> WordBreakClass
Gets the WordBreakClass.
sentence_break_class
fn sentence_break_class(self: Self) -> SentenceBreakClass
Gets the SentenceBreakClass (UAX #29).
grapheme_break_class
fn grapheme_break_class(self: Self) -> GraphemeBreakClass
Gets the GraphemeBreakClass.
east_asian_width_class
fn east_asian_width_class(self: Self) -> EastAsianWidthClass
Gets the EastAsianWidthClass.
is_emoji
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.
has_emoji_presentation
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.
is_default_ignorable
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.
has_script_extension
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.
is_east_asian
fn is_east_asian(self: Self) -> bool
Determines whether this Codepoint is an east asian char.
is_break_char
const fn is_break_char(self: Self) -> bool
Determines whether this Codepoint is a break char.
is_white_space
fn is_white_space(self: Self) -> bool
Determines whether this Codepoint is white space.
try_get_paired_bracket
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.
read_at
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).
is_in_range_inclusive
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyStructuralPartialEqPartialEqEqHashDebugDefaultFrom<Codepoint>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.