An open API service indexing awesome lists of open source software.

https://github.com/jiro4989/eastasianwidth

Library for East Asian Width in pure Nim.
https://github.com/jiro4989/eastasianwidth

eastasianwidth lib library nim

Last synced: 9 days ago
JSON representation

Library for East Asian Width in pure Nim.

Awesome Lists containing this project

README

        

:toc: left
:sectnums:

= eastasianwidth

eastasianwidth is EastAsianWidth library in pure Nim. +
This module is inspired by https://github.com/komagata/eastasianwidth[eastasianwidth].

image:https://travis-ci.org/jiro4989/eastasianwidth.svg?branch=master["Build Status", link="https://travis-ci.org/jiro4989/eastasianwidth"]

== 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

== Install

[source,bash]
nimble install eastasianwidth

== Usage

[source,nim]
----
import eastasianwidth
from unicode import runeAtPos

echo "hello".stringWidth # --> 5
echo "こんにちは".stringWidth # --> 10
echo "ABCDE".stringWidth # --> 10
echo "漢".runeAtPos(0).int.eastAsianWidth # --> W
----

== Documents

* https://jiro4989.github.io/eastasianwidth/eastasianwidth.html

== Links

* https://github.com/jiro4989/alignment[alignment] is a library to align text
that contains multibyte strings. alignment library uses eastasianwidth.