FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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).

    View source

    Members

    REPLACEMENT_CODEPOINT

    const REPLACEMENT_CODEPOINT: Codepoint
    

    The replacement codepoint that is used for non supported values.

    Source

    replacement_codepoint

    const fn replacement_codepoint() -> Codepoint
    

    The replacement codepoint that is used for non supported values.

    Source

    new

    const fn new(value: u32) -> Self
    

    Creates a new instance of Codepoint with the specified value.

    Source

    value

    const fn value(self: Self) -> u32
    

    Get the codepoint's value.

    Source

    general_category

    fn general_category(self: Self) -> GeneralCategory
    

    Gets the GeneralCategory.

    Source

    script

    fn script(self: Self) -> Script
    

    Gets the Script.

    Source

    bi_di_class

    fn bi_di_class(self: Self) -> BidiClass
    

    Gets the BidiClass.

    Source

    paired_bracket_type

    fn paired_bracket_type(self: Self) -> BidiPairedBracketType
    

    Gets the BidiPairedBracketType.

    Source

    line_break_class

    fn line_break_class(self: Self) -> LineBreakClass
    

    Gets the LineBreakClass.

    Source

    word_break_class

    fn word_break_class(self: Self) -> WordBreakClass
    

    Gets the WordBreakClass.

    Source

    sentence_break_class

    fn sentence_break_class(self: Self) -> SentenceBreakClass
    

    Gets the SentenceBreakClass (UAX #29).

    Source

    grapheme_break_class

    fn grapheme_break_class(self: Self) -> GraphemeBreakClass
    

    Gets the GraphemeBreakClass.

    Source

    east_asian_width_class

    fn east_asian_width_class(self: Self) -> EastAsianWidthClass
    

    Gets the EastAsianWidthClass.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    is_east_asian

    fn is_east_asian(self: Self) -> bool
    

    Determines whether this Codepoint is an east asian char.

    Source

    is_break_char

    const fn is_break_char(self: Self) -> bool
    

    Determines whether this Codepoint is a break char.

    Source

    is_white_space

    fn is_white_space(self: Self) -> bool
    

    Determines whether this Codepoint is white space.

    Source

    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.

    Source

    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).

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • 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.