Measure the width of text in the terminal and build simple layouts!
0

Configure Feed

Select the types of activity you want to include in your feed.

docs

+11 -5
+10 -4
internals.md
··· 52 52 behaviour is subject to ongoing discussion in the freedesktop.org terminal 53 53 working group. Support for this mode should therefore be considered best-effort 54 54 at the moment, especially when support for Brahmic, Arabic, and some east asian 55 - scripts is required. 55 + scripts is required. If you just want your emoji family to be 2 columns wide, 56 + this mode works well enough right now. 56 57 57 58 This library does the following: 58 59 ··· 68 69 Additionally, in the extended mode, the following rules apply: 69 70 70 71 - If a grapheme cluster contains two or more non-spacing non-zero-width 71 - codepoints, its width is wide. 72 + codepoints, its width is wide. "Spacing" codepoints in this context are all 73 + codepoints with a `General_Category` of `Spacing_Mark`. 72 74 73 75 This rule makes the width reported by this library across Erlang and Nodejs more 74 76 stable (Unicode version differences, see above), as well as closer match the ··· 101 103 102 104 # Testing 103 105 104 - I currently test against VTE (mainly gnome-terminal), Windows Terminal, Kitty, and foot for mode 2027 support. 106 + I currently test against VTE (mainly gnome-terminal), Windows Terminal, Kitty, 107 + and foot for mode 2027 support. I also test on Contour since they originally 108 + proposed the mode 2027 spec; however, they use a custom Unicode library that I 109 + don't trust fully. 105 110 106 - When reporting a mismatch, please include which terminal and the escaped codepoints. Gitlab/Discord sometimes like to strip certain modifiers. 111 + When reporting a mismatch, please include which terminal and the escaped 112 + codepoints. Gitlab/Discord sometimes like to strip certain modifiers.
+1 -1
src/string_width.gleam
··· 579 579 /// Replace all tab characters found in the string with the amount of spaces 580 580 /// that this tab would have had otherwise. 581 581 /// 582 - /// This makes it save to prepend to a line, without changing the spacing produced 582 + /// This makes it safe to prepend to a line, without changing the spacing produced 583 583 /// by tabs anymore. 584 584 /// 585 585 /// ### Examples