Approximates the number of text columns the 'cat()' function should use to print a string with a mono-spaced font.
character vector or an object coercible to
The Unicode standard does not formalize the notion of a character width. Roughly based on https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c and the UAX #11 we proceed as follows. The following code points are of width 0:
code points with general category (see stringi-search-charclass)
C1 control codes (general category
- for compatibility with the
Hangul Jamo medial vowels and final consonants
(code points with enumerable property
note that applying the NFC normalization with
ZERO WIDTH SPACE (U+200B),
Characters with the
UCHAR_EAST_ASIAN_WIDTH enumerable property
of width 2.
SOFT HYPHEN (U+00AD) (for compatibility with
as well as any other characters have width 1.
Returns an integer vector of the same length as
East Asian Width – Unicode Standard Annex #11, https://www.unicode.org/reports/tr11/
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.