code point width - xenomachina/xenocom GitHub Wiki

com.xenomachina.text.term / codePointWidth

codePointWidth

fun codePointWidth(ucs: Int): Int (source)

Returns an estimated cell width of a Unicode code point when displayed on a monospace terminal. Possible return values are -1, 0, 1 or 2. Control characters (other than null) and Del return -1.

This function is based on the public domain wcwidth.c written by Markus Kuhn.

⚠️ **GitHub.com Fallback** ⚠️