Trait UnicodeWidthChar

Source
pub trait UnicodeWidthChar: Sealed {
    // Required methods
    fn width(self) -> Option<usize>;
    fn width_cjk(self) -> Option<usize>;
}
Expand description

Methods for determining displayed width of Unicode characters.

Required Methods§

Source

fn width(self) -> Option<usize>

Returns the character’s displayed width in columns, or None if the character is a control character.

This function treats characters in the Ambiguous category according to Unicode Standard Annex #11 as 1 column wide. This is consistent with the recommendations for non-CJK contexts, or when the context cannot be reliably determined.

Source

fn width_cjk(self) -> Option<usize>

Returns the character’s displayed width in columns, or None if the character is a control character.

This function treats characters in the Ambiguous category according to Unicode Standard Annex #11 as 2 columns wide. This is consistent with the recommendations for CJK contexts.

Implementations on Foreign Types§

Source§

impl UnicodeWidthChar for char

Implementors§

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy