BSD Ports

textproc/p5-Text-CharWidth 0.04_2 MidnightBSD

Get number of occupied columns of a string on terminal

System
MidnightBSD
Repository
mports
Maintainer
[email protected]
License
artistic, gpl+
Categories
textproc, perl5

Description

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.

In the other systems

SystemPortVersion
MidnightBSDtextproc/p5-Text-CharWidth0.04_2
FreeBSDtextproc/p5-Text-CharWidth0.04_2
OpenBSDtextproc/p5-Text-CharWidth0.04p0
NetBSDtextproc/p5-Text-CharWidth0.04nb18
DragonFlytextproc/p5-Text-CharWidth0.04_2
HardenedBSDtextproc/p5-Text-CharWidth0.04_2
GhostBSDtextproc/p5-Text-CharWidth0.04_2

Install

Binary package:

mport install p5-Text-CharWidth

From mports:

cd /usr/mports/textproc/p5-Text-CharWidth && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	p5-Text-CharWidth>0:textproc/p5-Text-CharWidth

Dependencies

Configuration

No options to configure.

USES
perl5
Service scripts
none

Files

pkg-plist 3
  • %%SITE_ARCH%%/Text/CharWidth.pm
  • %%SITE_ARCH%%/auto/Text/CharWidth/CharWidth.so
  • %%PERL5_MAN3%%/Text::CharWidth.3.gz
distinfo 1
FileSizeSHA256
Text-CharWidth-0.04.tar.gz8387abded5f4fdd9338e89fd2f1d8271c44989dae5bf50aece41b6179d8e230704f8
Master sites 1
  • CPAN