diff options
author | chinsan <chinsan@FreeBSD.org> | 2008-08-31 16:31:02 +0800 |
---|---|---|
committer | chinsan <chinsan@FreeBSD.org> | 2008-08-31 16:31:02 +0800 |
commit | 3b233fe329e043eb3ece6cb2da3eb64c19569406 (patch) | |
tree | 412b028c70e2619b4efec8d16905220c109dd436 /textproc | |
parent | 7b8fba8e97b06fd7b2007a64648e74f1ce69aec6 (diff) | |
download | freebsd-ports-gnome-3b233fe329e043eb3ece6cb2da3eb64c19569406.tar.gz freebsd-ports-gnome-3b233fe329e043eb3ece6cb2da3eb64c19569406.tar.zst freebsd-ports-gnome-3b233fe329e043eb3ece6cb2da3eb64c19569406.zip |
Add p5-Text-CharWidth, get number of occupied columns of a string on terminal.
This module supplies features similar as wcwidth(3) and wcswidth(3) in C
language.
Characters have its own width on terminal depending on locale. For example,
ASCII characters occupy one column per character, east Asian fullwidth
characters (like Hiragana or Han Ideograph) occupy two columns per
character, and combining characters (apperaring in ISO-8859-11 Thai,
Unicode, and so on) occupy zero columns per character. mbwidth() gives the
width of the first character of the given string and mbswidth() gives the
width of the whole given string.
The names of mbwidth and mbswidth came from "multibyte" versions of wcwidth
and wcswidth which are "wide character" versions.
mblen(string) returns number of bytes of the first character of the string.
Please note that a character may consist of multiple bytes in multibyte
encodings such as UTF-8, EUC-JP, EUC-KR, GB2312, or Big5.
mbwidth(string) returns the width of the first character of the string.
mbswidth(string) returns the width of the whole string.
Parameters are to be given in locale encodings, not always in UTF-8.
WWW: http://search.cpan.org/dist/Text-CharWidth/
Diffstat (limited to 'textproc')
-rw-r--r-- | textproc/Makefile | 1 | ||||
-rw-r--r-- | textproc/p5-Text-CharWidth/Makefile | 21 | ||||
-rw-r--r-- | textproc/p5-Text-CharWidth/distinfo | 3 | ||||
-rw-r--r-- | textproc/p5-Text-CharWidth/pkg-descr | 24 | ||||
-rw-r--r-- | textproc/p5-Text-CharWidth/pkg-plist | 7 |
5 files changed, 56 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile index 000b653a135c..5bd8ad504baa 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -566,6 +566,7 @@ SUBDIR += p5-Text-CSV_PP SUBDIR += p5-Text-CSV_XS SUBDIR += p5-Text-Capitalize + SUBDIR += p5-Text-CharWidth SUBDIR += p5-Text-Chomp SUBDIR += p5-Text-Context-EitherSide SUBDIR += p5-Text-Decorator diff --git a/textproc/p5-Text-CharWidth/Makefile b/textproc/p5-Text-CharWidth/Makefile new file mode 100644 index 000000000000..03a7d56b8b24 --- /dev/null +++ b/textproc/p5-Text-CharWidth/Makefile @@ -0,0 +1,21 @@ +# New ports collection makefile for: p5-Text-CharWidth +# Date created: 2008/08/31 +# Whom: chinsan +# +# $FreeBSD$ +# + +PORTNAME= Text-CharWidth +DISTVERSION= 0.04 +CATEGORIES= textproc perl5 +MASTER_SITES= CPAN +PKGNAMEPREFIX= p5- + +MAINTAINER= chinsan@FreeBSD.org +COMMENT= Get number of occupied columns of a string on terminal + +PERL_CONFIGURE= YES + +MAN3= Text::CharWidth.3 + +.include <bsd.port.mk> diff --git a/textproc/p5-Text-CharWidth/distinfo b/textproc/p5-Text-CharWidth/distinfo new file mode 100644 index 000000000000..cca78239afeb --- /dev/null +++ b/textproc/p5-Text-CharWidth/distinfo @@ -0,0 +1,3 @@ +MD5 (Text-CharWidth-0.04.tar.gz) = 37a723df0580c0758c0ee67b37336c15 +SHA256 (Text-CharWidth-0.04.tar.gz) = abded5f4fdd9338e89fd2f1d8271c44989dae5bf50aece41b6179d8e230704f8 +SIZE (Text-CharWidth-0.04.tar.gz) = 8387 diff --git a/textproc/p5-Text-CharWidth/pkg-descr b/textproc/p5-Text-CharWidth/pkg-descr new file mode 100644 index 000000000000..5b2ef4d652e3 --- /dev/null +++ b/textproc/p5-Text-CharWidth/pkg-descr @@ -0,0 +1,24 @@ +This module supplies features similar as wcwidth(3) and wcswidth(3) in C +language. + +Characters have its own width on terminal depending on locale. For example, +ASCII characters occupy one column per character, east Asian fullwidth +characters (like Hiragana or Han Ideograph) occupy two columns per +character, and combining characters (apperaring in ISO-8859-11 Thai, +Unicode, and so on) occupy zero columns per character. mbwidth() gives the +width of the first character of the given string and mbswidth() gives the +width of the whole given string. + +The names of mbwidth and mbswidth came from "multibyte" versions of wcwidth +and wcswidth which are "wide character" versions. + +mblen(string) returns number of bytes of the first character of the string. +Please note that a character may consist of multiple bytes in multibyte +encodings such as UTF-8, EUC-JP, EUC-KR, GB2312, or Big5. + +mbwidth(string) returns the width of the first character of the string. +mbswidth(string) returns the width of the whole string. + +Parameters are to be given in locale encodings, not always in UTF-8. + +WWW: http://search.cpan.org/dist/Text-CharWidth/ diff --git a/textproc/p5-Text-CharWidth/pkg-plist b/textproc/p5-Text-CharWidth/pkg-plist new file mode 100644 index 000000000000..9da72966f9f9 --- /dev/null +++ b/textproc/p5-Text-CharWidth/pkg-plist @@ -0,0 +1,7 @@ +%%SITE_PERL%%/%%PERL_ARCH%%/auto/Text/CharWidth/CharWidth.so +%%SITE_PERL%%/%%PERL_ARCH%%/auto/Text/CharWidth/CharWidth.bs +%%SITE_PERL%%/%%PERL_ARCH%%/auto/Text/CharWidth/.packlist +%%SITE_PERL%%/%%PERL_ARCH%%/Text/CharWidth.pm +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Text/CharWidth +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Text +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/Text |