github.com/puellanivis/breton@v0.2.16/lib/display/width/tables.go (about) 1 package width 2 3 import ( 4 "unicode" 5 6 "golang.org/x/text/unicode/rangetable" 7 ) 8 9 // AdditionalZeroWidth is a Unicode Range of expected zero-width glyphs outside of Cf, Mn, and Me. 10 var AdditionalZeroWidth = &unicode.RangeTable{ 11 R16: []unicode.Range16{ 12 {0x1160, 0x11FF, 1}, // Hangul Jamo medial vowels and final consonants. 13 }, 14 } 15 16 // ZeroWidth is a Unicode Range that can be expected to be zero-width glyphs on a terminal. 17 var ZeroWidth = rangetable.Merge(unicode.Cf, unicode.Mn, unicode.Me, AdditionalZeroWidth) 18 19 // DoubleWidth is a Unicode Range that can be safely assumed to be Wide, even if not EastAsian{Wide,Fullwidth}. 20 var DoubleWidth = &unicode.RangeTable{ 21 R32: []unicode.Range32{ 22 {Lo: 0x1F030, Hi: 0x1F061, Stride: 1}, // Domino Tiles (horizontal) 23 {Lo: 0x1F100, Hi: 0x1F1FF, Stride: 1}, // Enclosed Alphanumeric Supplement 24 {Lo: 0x1F200, Hi: 0x1F2FF, Stride: 1}, // Enclosed Ideographic Supplement 25 {Lo: 0x1F300, Hi: 0x1F5FF, Stride: 1}, // Miscellaneous Symbols and Pictographs 26 {Lo: 0x1F600, Hi: 0x1F64F, Stride: 1}, // Emoticons 27 {Lo: 0x1F680, Hi: 0x1F6FF, Stride: 1}, // Transport and Map Symbols 28 {Lo: 0x1F900, Hi: 0x1F9FF, Stride: 1}, // Supplemental Symbols and Pictographs 29 }, 30 }