Lines Matching defs:width
14 /// that this version of unicode-width is based on.
20 /// Returns the [UAX #11](https://www.unicode.org/reports/tr11/) based width of `c` by
22 /// If `is_cjk == true`, ambiguous width characters are treated as double width; otherwise,
23 /// they're treated as single width.
44 // Since this is the last table, each entry represents an encoded width.
47 // Extract the packed width
48 let width = packed_widths >> (2 * (cp & 0b11)) & 0b11;
50 // A width of 3 signifies that the codepoint is ambiguous width.
51 if width == 3 {
58 width.into()
62 /// Returns the [UAX #11](https://www.unicode.org/reports/tr11/) based width of `c`, or
64 /// If `is_cjk == true`, ambiguous width characters are treated as double width; otherwise,
65 /// they're treated as single width.
67 pub fn width(c: char, is_cjk: bool) -> Option<usize> {
70 // U+0020 to U+007F (exclusive) are single-width ASCII codepoints