on master help sign in
installUnicodeWidthTable: improve documentation
commit36b72dc2ed7a15c64f5c36fadbc2cc2dce92167a authorJonathan Daugherty <cygnus@foobox.com> dateTue 3 Mar 2020, 13:12 (7 years ago) parent1545df3
1 file changed+20−9
src/Graphics/Vty/UnicodeWidthTable/Install.hs+20−9
src/Graphics/Vty/UnicodeWidthTable/Install.hs+20−9
@@ -37,15 +37,26 @@ tableSize = 0x110000
3737
3838-- | Install a custom unicode character width table.
3939--
40−-- This affects the behavior of the 'wcwidth' function and functions
41−-- that call it. It does so by changing global state available to the C
42−-- implementation of 'wcwidth'. To ensure that your program gets consistent
43−-- results from evaluating calls to 'wcwidth', the installation of a
44−-- custom table should be performed before you call 'wcwidth' in your
45−-- program. This is best done at Vty startup. It's also important to
46−-- note that once a custom table has been installed, it is permanent for
47−-- the life of the process. No new table can be installed, and the new
48−-- custom table cannot be removed.
40+-- This affects the behavior of the 'Graphics.Vty.Image.wcwidth'
41+-- function and functions that call it. It does so by
42+-- changing global state available to the C implementation
43+-- of 'Graphics.Vty.Image.wcwidth'. To ensure that your
44+-- program gets consistent results from evaluating calls to
45+-- 'Graphics.Vty.Image.wcwidth', the installation of a custom table
46+-- should be performed before you call 'Graphics.Vty.Image.wcwidth' in
47+-- your program.
48+--
49+-- This is best done at Vty startup, and if you use
50+-- 'Graphics.Vty.mkVty', that function calls this automatically based on
51+-- the Vty configuration's declared width tables. It is exposed as part
52+-- of the public API so that applications can call this as needed if
53+-- they don't want to control the terminal with 'mkVty' but do want to
54+-- make calls to 'Graphics.Vty.Image.wcwidth'.
55+--
56+-- It's also important to note that once a
57+-- custom table has been installed, it is permanent for the life of the
58+-- process. No new table can be installed, and the new custom table
59+-- cannot be removed.
4960--
5061-- If this function fails for any reason -- if the table cannot be
5162-- installed or is invalid, or if a custom table already exists -- this