[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [ANN] wcwidth - Calculate number of character cells used by a Unicode rune
- From: Adrián Pérez de Castro <aperez@...>
- Date: Tue, 12 Jul 2016 23:45:58 +0200
Hello,
GitHub: https://github.com/aperezdc/lua-wcwidth
LuaRocks: luarocks install wcwidth
The lua-wcwidth module implements the wcwidth(3) function as specified by
the POSIX.1-2001 and POSIX.1-2008 specifications in pure Lua, without any
dependencies.
This function is mostly useful to determine how many “cells” a character
takes, in order to precisely write and position Unicode text content into
a terminal — or into any other output device using monospaced fonts.
This module has been born as a byproduct needed to implement a module for
line-based terminal input [1] Lua which can be integrated with cqueues [2]
for asynchronous operation *and* has proper Unicode support.
Have fun playing with it, though I suspect it will be only useful for code
which needs to do text terminal output :-)
Cheers,
--
☛ Adrián
[1] https://github.com/aperezdc/lua-lineinput (beware, WIP code!)
[2] https://luarocks.org/modules/daurnimator/cqueues
Attachment:
signature.asc
Description: signature