class UnicodeCharWidth::Condition

Defined in:

charwidth/charwidth.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(east_asian : Bool = Condition.handle_env, strict_emoji_neutral : Bool = true) #

[View source]

Instance Method Detail

def ambiguous?(codepoint : Int32) #

returns whether is ambiguous width or not


[View source]
def east_asian : Bool #

Will be set to true if the current locale is CJK


[View source]
def east_asian=(east_asian : Bool) #

Will be set to true if the current locale is CJK


[View source]
def neutral?(codepoint : Int32) #

returns whether is neutral width or not


[View source]
def pad_left(str : String, w : Int32) #

returns a string filled in left by spaces in w cells


[View source]
def pad_right(str : String, w : Int32) #

returns a string filled in right by spaces in w cells


[View source]
def strict_emoji_neutral : Bool #

should be set to false if handle broken fonts


[View source]
def strict_emoji_neutral=(strict_emoji_neutral : Bool) #

should be set to false if handle broken fonts


[View source]
def truncate(str : String, w : Int32, tail : String) #

return string truncated with w cells


[View source]
def width(codepoint : Int32) #

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


[View source]
def width(char : Char) #

return the number of cells in `char'


[View source]
def width(str : String) #

returns string width


[View source]
def wrap(str : String, w : Int32) #

returns a string wrapped with w cells


[View source]