@@ -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)