~jaro/balkon

ref: 1555a8cc7b5b6ad8c7f365564876dc6f5649f19c balkon/src/Data/Text/ParagraphLayout/Internal/ResolvedSpan.hs -rw-r--r-- 829 bytes
1555a8ccJaro Move non-public modules into Internal namespace. 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Data.Text.ParagraphLayout.Internal.ResolvedSpan (ResolvedSpan(..))
where

import Data.Text (Text)
import Data.Text.Glyphize (Font)
import qualified Data.Text.ICU as BreakStatus (Line)

import Data.Text.ParagraphLayout.Internal.LineHeight
import Data.Text.ParagraphLayout.Internal.TextContainer

-- | Internal structure containing resolved values that may be shared with
-- other spans across the paragraph.
data ResolvedSpan = ResolvedSpan
    { spanIndex :: Int
    , spanOffsetInParagraph :: Int
    , spanText :: Text
    , spanFont :: Font
    , spanLineHeight :: LineHeight
    , spanLanguage :: String
    , spanLineBreaks :: [(Int, BreakStatus.Line)]
    }
    deriving (Show)

instance Eq ResolvedSpan where
    a == b = spanIndex a == spanIndex b

instance TextContainer ResolvedSpan where
    getText = spanText