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.

mode_wcwidth just for docs

+11
+11
src/string_width.gleam
··· 82 82 Options(..options, mode: Mode2027Ext) 83 83 } 84 84 85 + /// The default mode and the mode suitable for most terminals. 86 + /// 87 + /// Measures individual code points, similar to the libc `wcwidth` function 88 + /// that almost all of these terminals use. 89 + /// 90 + /// Note that except for `fold_raw`, this library will still always process 91 + /// grapheme clusters as a unit. 92 + pub fn mode_wcwidth(options: Options) -> Options { 93 + Options(..options, mode: ModeWcwidth) 94 + } 95 + 85 96 /// Some characters are marked by Unicode as "ambiguous", meaning they may 86 97 /// occupy 1 or 2 cells, depending on the context, current language, selected 87 98 /// font, surrounding text, and more.