class

UnicodeCharWidth::Condition

Inherits Reference < Object

Constructors

new(east_asian : Bool = Condition.handle_env, strict_emoji_neutral : Bool = true)
Source

Instance methods

ambiguous?(codepoint : Int32)

returns whether is ambiguous width or not

Source
east_asian

Will be set to true if the current locale is CJK

Source
east_asian=(east_asian : Bool)

Will be set to true if the current locale is CJK

Source
neutral?(codepoint : Int32)

returns whether is neutral width or not

Source
pad_left(str : String, w : Int32)

returns a string filled in left by spaces in w cells

Source
pad_right(str : String, w : Int32)

returns a string filled in right by spaces in w cells

Source
strict_emoji_neutral

should be set to false if handle broken fonts

Source
strict_emoji_neutral=(strict_emoji_neutral : Bool)

should be set to false if handle broken fonts

Source
truncate(str : String, w : Int32, tail : String)

return string truncated with w cells

Source
width(codepoint : Int32)

returns the number of cells in codepoint see http://www.unicode.org/reports/tr11/

Source
width(char : Char)

return the number of cells in `char'

Source
width(str : String)

returns string width

Source
wrap(str : String, w : Int32)

returns a string wrapped with w cells

Source