on master help sign in
Add Graphics.Vty.UnicodeWidthTable.Types (data types for unicode width tables)
345c0bfJonathan Daugherty
src/Graphics/Vty/UnicodeWidthTable/Types.hsnew file+28
@@ -0,0 +1,28 @@
1+module Graphics.Vty.UnicodeWidthTable.Types
2+ ( UnicodeWidthTable(..)
3+ , WidthTableRange(..)
4+ )
5+where
6+
7+import Data.Word (Word8, Word32)
8+
9+-- | A range of code points in a width table.
10+data WidthTableRange =
11+ WidthTableRange { rangeStart :: Word32
12+ -- ^ The range's starting code point.
13+ , rangeSize :: Word32
14+ -- ^ The number of code points in the range,
15+ -- including the starting code point.
16+ , rangeColumns :: Word8
17+ -- ^ The terminal width, in columns, of all of the
18+ -- characters corresponding to the code points in
19+ -- this range.
20+ }
21+ deriving (Eq, Show)
22+
23+-- | A table of Unicode character widths.
24+data UnicodeWidthTable =
25+ UnicodeWidthTable { unicodeWidthTableRanges :: [WidthTableRange]
26+ -- ^ The ranges in the table.
27+ }
28+ deriving (Show)
vty.cabal+1
@@ -99,6 +99,7 @@ library
99 Graphics.Vty.Output.Interface
99 Graphics.Vty.Output.Interface
100 Graphics.Vty.Output.XTermColor
100 Graphics.Vty.Output.XTermColor
101 Graphics.Vty.Output.TerminfoBased
101 Graphics.Vty.Output.TerminfoBased
102+ Graphics.Vty.UnicodeWidthTable.Types
102
103
103 other-modules: Graphics.Vty.Attributes.Color240
104 other-modules: Graphics.Vty.Attributes.Color240
104 Graphics.Vty.Debug.Image
105 Graphics.Vty.Debug.Image