Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.22 KB

README.adoc

File metadata and controls

53 lines (34 loc) · 1.22 KB

eastasianwidth

eastasianwidth is EastAsianWidth library in pure Nim.
This module is inspired by eastasianwidth.

Build Status

1. Development

nim -v

Nim Compiler Version 0.19.4 [Linux: amd64]
Compiled at 2019-02-01
Copyright (c) 2006-2018 by Andreas Rumpf
git hash: b6d96cafc8bcad1f3d32f2910b25cd11a93f7751
active boot switches: -d:release

nimble -v

nimble v0.9.0 compiled at 2018-10-27 18:10:03
git hash: couldn't determine git hash

2. Install

nimble install eastasianwidth

3. Usage

import eastasianwidth
from unicode import runeAtPos

echo "hello".stringWidth                  # --> 5
echo "こんにちは".stringWidth             # --> 10
echo "ABCDE".stringWidth             # --> 10
echo "".runeAtPos(0).int.eastAsianWidth # --> W
  • alignment is a library to align text that contains multibyte strings. alignment library uses eastasianwidth.