File: wcswidth.man

package info (click to toggle)
tcllib 2.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,560 kB
  • sloc: tcl: 306,798; ansic: 14,272; sh: 3,035; xml: 1,766; yacc: 1,157; pascal: 881; makefile: 124; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (54 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[vset VERSION 35.3]
[manpage_begin textutil::wcswidth n [vset VERSION]]
[see_also regexp(n)]
[see_also split(n)]
[see_also string(n)]
[keywords prefix]
[keywords {regular expression}]
[keywords string]
[keywords {character type} {character width} {double-wide character}]
[moddesc   {Text and string utilities, macro processing}]
[titledesc {Procedures to compute terminal width of strings}]
[category  {Text processing}]
[require Tcl "8.5 9"]
[require textutil::wcswidth [opt [vset VERSION]]]
[description]

The package [package textutil::wcswidth] provides commands that determine character type and width
when used in terminals, and the length of strings when printed in a terminal.

[para] The data underlying the functionality of this package is provided by the Unicode database
file [uri http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt].

[para]

The complete set of procedures is described below.

[list_begin definitions]

[call [cmd ::textutil::wcswidth] [arg string]]

Returns the number of character cells taken by the string when printed to the terminal.

This takes double-wide characters from the various Asian and other scripts into account.

[call [cmd ::textutil::wcswidth_char] [arg char]]

Returns the number of character cells taken by the character when printed to the terminal.

[para][emph Beware]: The character [arg char] is specified as Unicode codepoint.

[call [cmd ::textutil::wcswidth_type] [arg char]]

Returns the character type of the specified character.

This a single character in the set of [const A], [const F], [const H], [const N], [const Na], and
[const W], as specified per [uri http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt]

[para][emph Beware]: The character [arg char] is specified as Unicode codepoint.

[list_end]

[vset CATEGORY textutil]
[include ../common-text/feedback.inc]
[manpage_end]