module

Phosphor::Width

Terminal display width utilities.

All cell-counting in the render pipeline must go through this module, never String#size or .bytes. CJK and emoji occupy 2 cells; combining marks occupy 0.

Class methods

of(char : Char) : Int32

Returns the terminal display width of char: 0 (combining/control), 1, or 2 (wide).

Source