Skip to content

jiro4989/eastasianwidth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.