Safe Haskell | None |
---|---|
Language | Haskell2010 |
Interface for laying out paragraphs of rich text.
The main entry point is the function layoutRich
.
Synopsis
- data Paragraph d = Paragraph Array Int (RootNode Int d) ParagraphOptions
- constructParagraph :: Text -> RootNode Text d -> Text -> ParagraphOptions -> Paragraph d
- data BoxSpacing = BoxSpacingLeftRight Int32 Int32
- data LineHeight
- data ParagraphOptions
- defaultParagraphOptions :: ParagraphOptions
- paragraphLineHeight :: ParagraphOptions -> LineHeight
- paragraphMaxWidth :: ParagraphOptions -> Int32
- data RootNode t d = RootBox (Box t d)
- data InnerNode t d
- = InlineBox d (Box t d) BoxOptions
- | TextSequence d t
- data Box t d = Box [InnerNode t d] TextOptions
- data BoxOptions
- defaultBoxOptions :: BoxOptions
- data TextOptions
- defaultTextOptions :: Direction -> TextOptions
- boxSpacing :: BoxOptions -> BoxSpacing
- textFont :: TextOptions -> Font
- textLineHeight :: TextOptions -> LineHeight
- textLanguage :: TextOptions -> String
- textDirection :: TextOptions -> Direction
- paragraphSpanBounds :: Paragraph d -> NonEmpty Int
- paragraphSpanTexts :: Paragraph d -> [Text]
- paragraphText :: Paragraph d -> Text
- layoutRich :: Paragraph d -> ParagraphLayout d
- data ParagraphLayout d = ParagraphLayout {
- paragraphRect :: Rect Int32
- paragraphFragments :: [Fragment d]
- data Fragment d = Fragment {
- fragmentUserData :: d
- fragmentLine :: Int
- fragmentAncestorBoxes :: [AncestorBox d]
- fragmentRect :: Rect Int32
- fragmentPen :: (Int32, Int32)
- fragmentGlyphs :: [(GlyphInfo, GlyphPos)]
- fragmentSpacedRect :: Fragment d -> Rect Int32
- data AncestorBox d = AncestorBox {
- boxUserData :: d
- boxLeftEdge :: BoxEdge
- boxRightEdge :: BoxEdge
- boxStartEdge :: BoxEdge
- boxEndEdge :: BoxEdge
- data BoxEdge
- = NoEdge
- | SpacedEdge Int32
Documentation
constructParagraph :: Text -> RootNode Text d -> Text -> ParagraphOptions -> Paragraph d #
data BoxSpacing #
BoxSpacingLeftRight Int32 Int32 |
Instances
Eq BoxSpacing | |
Defined in Data.Text.ParagraphLayout.Internal.BoxOptions (==) :: BoxSpacing -> BoxSpacing -> Bool (/=) :: BoxSpacing -> BoxSpacing -> Bool | |
Read BoxSpacing | |
Defined in Data.Text.ParagraphLayout.Internal.BoxOptions readsPrec :: Int -> ReadS BoxSpacing readList :: ReadS [BoxSpacing] readPrec :: ReadPrec BoxSpacing readListPrec :: ReadPrec [BoxSpacing] | |
Show BoxSpacing | |
Defined in Data.Text.ParagraphLayout.Internal.BoxOptions showsPrec :: Int -> BoxSpacing -> ShowS show :: BoxSpacing -> String showList :: [BoxSpacing] -> ShowS |
data LineHeight #
Instances
Eq LineHeight | |
Defined in Data.Text.ParagraphLayout.Internal.LineHeight (==) :: LineHeight -> LineHeight -> Bool (/=) :: LineHeight -> LineHeight -> Bool | |
Read LineHeight | |
Defined in Data.Text.ParagraphLayout.Internal.LineHeight readsPrec :: Int -> ReadS LineHeight readList :: ReadS [LineHeight] readPrec :: ReadPrec LineHeight readListPrec :: ReadPrec [LineHeight] | |
Show LineHeight | |
Defined in Data.Text.ParagraphLayout.Internal.LineHeight showsPrec :: Int -> LineHeight -> ShowS show :: LineHeight -> String showList :: [LineHeight] -> ShowS |
data ParagraphOptions #
Instances
Eq ParagraphOptions | |
Defined in Data.Text.ParagraphLayout.Internal.ParagraphOptions (==) :: ParagraphOptions -> ParagraphOptions -> Bool (/=) :: ParagraphOptions -> ParagraphOptions -> Bool |
Paragraph options
These are record selectors that can be used for reading as well as updating specific option fields.
paragraphMaxWidth :: ParagraphOptions -> Int32 #
Content tree
InlineBox d (Box t d) BoxOptions | |
TextSequence d t |
Box [InnerNode t d] TextOptions |
data BoxOptions #
Instances
Eq BoxOptions | |
Defined in Data.Text.ParagraphLayout.Internal.BoxOptions (==) :: BoxOptions -> BoxOptions -> Bool (/=) :: BoxOptions -> BoxOptions -> Bool |
data TextOptions #
Instances
Eq TextOptions | |
Defined in Data.Text.ParagraphLayout.Internal.TextOptions (==) :: TextOptions -> TextOptions -> Bool (/=) :: TextOptions -> TextOptions -> Bool |
Box options
These are record selectors that can be used for reading as well as updating specific option fields.
boxSpacing :: BoxOptions -> BoxSpacing #
Text options
These are record selectors that can be used for reading as well as updating specific option fields.
textFont :: TextOptions -> Font #
textLineHeight :: TextOptions -> LineHeight #
textLanguage :: TextOptions -> String #
textDirection :: TextOptions -> Direction #
Verification
paragraphSpanBounds :: Paragraph d -> NonEmpty Int #
paragraphSpanTexts :: Paragraph d -> [Text] #
paragraphText :: Paragraph d -> Text #
Output layout
layoutRich :: Paragraph d -> ParagraphLayout d #
data ParagraphLayout d #
ParagraphLayout | |
|
Instances
Fragment | |
|
Instances
Eq d => Eq (Fragment d) | |
Read d => Read (Fragment d) | |
Defined in Data.Text.ParagraphLayout.Internal.Fragment | |
Show d => Show (Fragment d) | |
fragmentSpacedRect :: Fragment d -> Rect Int32 #
data AncestorBox d #
AncestorBox | |
|
Instances
Eq d => Eq (AncestorBox d) | |
Defined in Data.Text.ParagraphLayout.Internal.AncestorBox (==) :: AncestorBox d -> AncestorBox d -> Bool (/=) :: AncestorBox d -> AncestorBox d -> Bool | |
Read d => Read (AncestorBox d) | |
Defined in Data.Text.ParagraphLayout.Internal.AncestorBox readsPrec :: Int -> ReadS (AncestorBox d) readList :: ReadS [AncestorBox d] readPrec :: ReadPrec (AncestorBox d) readListPrec :: ReadPrec [AncestorBox d] | |
Show d => Show (AncestorBox d) | |
Defined in Data.Text.ParagraphLayout.Internal.AncestorBox showsPrec :: Int -> AncestorBox d -> ShowS show :: AncestorBox d -> String showList :: [AncestorBox d] -> ShowS |
NoEdge | |
SpacedEdge Int32 |