FreeBSD Ports

textproc/p5-Text-CharWidth 0.04_2

Get number of occupied columns of a string on terminal

Repository
FreeBSD ports
Maintainer
[email protected]
License
ART10, GPLv1+
Categories
textproc, perl5
Package size
9.7 KiB, 18.2 KiB installed

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.

Install

As a binary package — by origin, or by package name:

pkg install textproc/p5-Text-CharWidth
pkg install p5-Text-CharWidth

From the ports tree:

cd /usr/ports/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

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest0.04_20.04_20.04_20.04_20.04_2
FreeBSD:14:quarterly0.04_20.04_2n/a0.04_20.04_2
FreeBSD:15:latest0.04_20.04_2n/a0.04_20.04_2
FreeBSD:15:quarterly0.04_20.04_2n/an/an/a
FreeBSD:16:latest0.04_20.04_2n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

The Makefile names none itself; they come from USES and USE_*.

The full lists below include those, and their dependencies in turn.

All build dependencies 1
All run dependencies 1

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

Commit history 0

No commits in the history this site was built from.