package runewidth
import "github.com/mattn/go-runewidth"
Index ¶
- Variables
- func FillLeft(s string, w int) string
- func FillRight(s string, w int) string
- func IsAmbiguousWidth(r rune) bool
- func IsEastAsian() bool
- func IsNeutralWidth(r rune) bool
- func RuneWidth(r rune) int
- func StringWidth(s string) (width int)
- func Truncate(s string, w int, tail string) string
- func Wrap(s string, w int) string
- type Condition
- func NewCondition() *Condition
- func (c *Condition) FillLeft(s string, w int) string
- func (c *Condition) FillRight(s string, w int) string
- func (c *Condition) RuneWidth(r rune) int
- func (c *Condition) StringWidth(s string) (width int)
- func (c *Condition) Truncate(s string, w int, tail string) string
- func (c *Condition) Wrap(s string, w int) string
Variables ¶
var ( // EastAsianWidth will be set true if the current locale is CJK EastAsianWidth bool // ZeroWidthJoiner is flag to set to use UTR#51 ZWJ ZeroWidthJoiner bool // DefaultCondition is a condition in current locale DefaultCondition = &Condition{} )
Functions ¶
func FillLeft ¶
FillLeft return string filled in left by spaces in w cells
func FillRight ¶
FillRight return string filled in left by spaces in w cells
func IsAmbiguousWidth ¶
IsAmbiguousWidth returns whether is ambiguous width or not.
func IsEastAsian ¶
func IsEastAsian() bool
IsEastAsian return true if the current locale is CJK
func IsNeutralWidth ¶
IsNeutralWidth returns whether is neutral width or not.
func RuneWidth ¶
RuneWidth returns the number of cells in r. See http://www.unicode.org/reports/tr11/
func StringWidth ¶
StringWidth return width as you can see
func Truncate ¶
Truncate return string truncated with w cells
func Wrap ¶
Wrap return string wrapped with w cells
Types ¶
type Condition ¶
Condition have flag EastAsianWidth whether the current locale is CJK or not.
func NewCondition ¶
func NewCondition() *Condition
NewCondition return new instance of Condition which is current locale.
func (*Condition) FillLeft ¶
FillLeft return string filled in left by spaces in w cells
func (*Condition) FillRight ¶
FillRight return string filled in left by spaces in w cells
func (*Condition) RuneWidth ¶
RuneWidth returns the number of cells in r. See http://www.unicode.org/reports/tr11/
func (*Condition) StringWidth ¶
StringWidth return width as you can see
func (*Condition) Truncate ¶
Truncate return string truncated with w cells
func (*Condition) Wrap ¶
Wrap return string wrapped with w cells
Source Files ¶
runewidth.go runewidth_posix.go runewidth_table.go
Directories ¶
Path | Synopsis |
---|---|
script |
- Version
- v0.0.6
- Published
- Nov 3, 2019
- Platform
- darwin/amd64
- Imports
- 3 packages
- Last checked
- now –
Tools for package owners.