~jaro/balkon

ref: c5e25e2b7a77d3af82227c1151820c2f4ddc559f balkon/lib/Data/Text/ParagraphLayout/Rich.hs -rw-r--r-- 3.1 KiB
c5e25e2bJaro Clean up vertical alignment code structure. 1 year, 4 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
-- | Interface for laying out paragraphs of rich text.
--
-- The main entry point is the function `layoutRich`.
module Data.Text.ParagraphLayout.Rich
    -- * Input paragraph
    ( Paragraph (Paragraph)
    , constructParagraph
    , ParagraphAlignment
        ( AlignStart
        , AlignEnd
        , AlignLeft
        , AlignRight
        , AlignCentreH
        )
    , BoxCollapse (AllowBoxCollapse, AvoidBoxCollapse)
    , BoxSpacing (BoxSpacingLeftRight)
    , VerticalAlignment
        ( AlignLineTop
        , AlignLineBottom
        , AlignBaseline
        )
    , LineHeight (Absolute, Normal)
    , ParagraphOptions
    , defaultParagraphOptions
    -- ** Paragraph options
    -- | These are record selectors that can be used for reading
    -- as well as updating specific option fields.
    , paragraphAlignment
    , paragraphMaxWidth
    -- NOTE: `paragraphFont` is only used by the legacy plain text interface,
    --       and is therefore not exported here.
    -- ** Content tree
    , RootNode (RootBox)
    , InnerNode (InlineBox, TextSequence)
    , Box (Box)
    , EmptyText
    , strut
    , BoxOptions
    , defaultBoxOptions
    , TextOptions
    , defaultTextOptions
    -- ** Box options
    -- | These are record selectors that can be used for reading
    -- as well as updating specific option fields.
    , boxSpacing
    , boxCollapse
    , boxVerticalAlignment
    , activateBoxSpacing
    -- ** Text options
    -- | These are record selectors that can be used for reading
    -- as well as updating specific option fields.
    , textFont
    , textAscender
    , textDescender
    , textLineHeight
    , textLanguage
    , textDirection
    -- ** Verification
    , paragraphSpanBounds
    , paragraphSpanTexts
    , paragraphText
    -- * Output layout
    , layoutRich
    , ParagraphLayout
        ( ParagraphLayout
        , paragraphRect
        , paragraphLines
        , paragraphFragments
        )
    , paragraphSafeWidth
    , Line
        ( Line
        , lineNumber
        , lineRect
        )
    , Fragment
        ( Fragment
        , fragmentUserData
        , fragmentLine
        , fragmentAncestorBoxes
        , fragmentContentRect
        , fragmentRect
        , fragmentPen
        , fragmentGlyphs
        )
    , fragmentSpacedRect
    , AncestorBox
        ( AncestorBox
        , boxUserData
        , boxLeftEdge
        , boxRightEdge
        , boxStartEdge
        , boxEndEdge
        )
    , BoxEdge (NoEdge, SpacedEdge)
    )
where

import Data.Text.ParagraphLayout.Internal.AncestorBox
import Data.Text.ParagraphLayout.Internal.BoxOptions
import Data.Text.ParagraphLayout.Internal.Fragment
import Data.Text.ParagraphLayout.Internal.Line
import Data.Text.ParagraphLayout.Internal.LineHeight
import Data.Text.ParagraphLayout.Internal.ParagraphAlignment
import Data.Text.ParagraphLayout.Internal.ParagraphOptions
import Data.Text.ParagraphLayout.Internal.Rich
import Data.Text.ParagraphLayout.Internal.Rich.Paragraph
import Data.Text.ParagraphLayout.Internal.Rich.ParagraphLayout
import Data.Text.ParagraphLayout.Internal.TextOptions
import Data.Text.ParagraphLayout.Internal.Tree