on master help sign in
Document buildUnicodeWidthTable
commit9e785f693fe565349ef2a226f5f50d8f8d121ab2 authorJonathan Daugherty <cygnus@foobox.com> dateThu 27 Feb 2020, 16:08 (7 years ago) parente8841e7
1 file changed+6
src/Graphics/Vty/UnicodeWidthTable/Query.hs+6
src/Graphics/Vty/UnicodeWidthTable/Query.hs+6
@@ -41,6 +41,12 @@ mkRanges pairs =
4141 else go (Just (WidthTableRange c 1 width)) (r:finishedRanges) rest
4242 in go Nothing [] convertedPairs
4343
44+-- | Construct a unicode character width table by querying the terminal
45+-- connected to stdout. This works by emitting characters to stdout
46+-- and then querying the terminal to determine the resulting cursor
47+-- position in order to measure character widths. Consequently this will
48+-- generate a lot of output and may take a while, depending on your
49+-- system performance.
4450buildUnicodeWidthTable :: IO UnicodeWidthTable
4551buildUnicodeWidthTable = do
4652 pairs <- fmap catMaybes $ forM ['\0'..'\x2FFFF'] $ \i ->