summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorChin-San Huang <chinsan@FreeBSD.org>2008-08-31 08:31:02 +0000
committerChin-San Huang <chinsan@FreeBSD.org>2008-08-31 08:31:02 +0000
commitd2d421fd99442de3cc46828fc189d8c5f4e33dbc (patch)
tree673d5fdeee089354cc86b4c270700cdbd40acd4c /textproc
parent- Unbreak this port by using emacs 21 (this port is integrated into emacs22) (diff)
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/
Notes
Notes: svn path=/head/; revision=219506
Diffstat (limited to 'textproc')
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/p5-Text-CharWidth/Makefile21
-rw-r--r--textproc/p5-Text-CharWidth/distinfo3
-rw-r--r--textproc/p5-Text-CharWidth/pkg-descr24
-rw-r--r--textproc/p5-Text-CharWidth/pkg-plist7
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