Table of Contents
eastasianwidth is EastAsianWidth library in pure Nim.
This module is inspired by eastasianwidth.
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
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.