From 2473b322080ff5df1a7d83f0fc74e19ddbc9007f Mon Sep 17 00:00:00 2001 From: Jonathan Daugherty Date: Fri, 5 Aug 2022 15:26:28 -0700 Subject: [PATCH] guide: some clarifying edits for text width issues --- docs/guide.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/guide.rst b/docs/guide.rst index ca24f7c..997d62d 100644 --- a/docs/guide.rst +++ b/docs/guide.rst @@ -989,17 +989,18 @@ to support wide characters in your application, this will not work: let width = Data.Text.length t -because if the string contains any wide characters, their widths -will not be counted properly. In order to get this right, use the -``TextWidth`` type class to compute the width: +If the string contains any wide characters, their widths will not be +counted properly. In order to get this right, use the ``TextWidth`` type +class to compute the width: .. code:: haskell let width = Brick.Widgets.Core.textWidth t -The ``TextWidth`` type class uses Vty's character width routine -to compute the correct width. If you need to compute -the width of a single character, use ``Graphics.Text.wcwidth``. +The ``TextWidth`` type class uses Vty's character width routine to +compute the width by looking up the string's characdters in a Unicode +width table. If you need to compute the width of a single character, use +``Graphics.Text.wcwidth``. Extents =======