No description
Find a file
2019-05-30 17:14:08 +09:00
docs ♻️ Change directory structure. 2019-04-14 00:30:47 +09:00
examples 💚 Add example code. 2019-04-14 19:03:06 +09:00
src 🐛 絵文字が1文字として扱われていたのを1文字として扱われるようにした 2019-05-24 15:29:08 +09:00
tests 🐛 絵文字が1文字として扱われていたのを1文字として扱われるようにした 2019-05-24 15:29:08 +09:00
.gitignore 💚 Add example code. 2019-04-14 19:03:06 +09:00
.travis.yml ♻️ add CI tasks 2019-04-23 23:39:30 +09:00
eastasianwidth.nimble version up 2019-05-24 15:29:48 +09:00
README.adoc 📝 add my other library link 2019-05-30 17:14:08 +09:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

: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 "".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.