| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Text.ParagraphLayout.Rich
Description
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 #
Constructors
| BoxSpacingLeftRight Int32 Int32 |
Instances
| Eq BoxSpacing | |
| Read BoxSpacing | |
Defined in Data.Text.ParagraphLayout.Internal.BoxOptions Methods readsPrec :: Int -> ReadS BoxSpacing readList :: ReadS [BoxSpacing] readPrec :: ReadPrec BoxSpacing readListPrec :: ReadPrec [BoxSpacing] | |
| Show BoxSpacing | |
Defined in Data.Text.ParagraphLayout.Internal.BoxOptions Methods showsPrec :: Int -> BoxSpacing -> ShowS show :: BoxSpacing -> String showList :: [BoxSpacing] -> ShowS | |
data LineHeight #
Instances
| Eq LineHeight | |
| Read LineHeight | |
Defined in Data.Text.ParagraphLayout.Internal.LineHeight Methods readsPrec :: Int -> ReadS LineHeight readList :: ReadS [LineHeight] readPrec :: ReadPrec LineHeight readListPrec :: ReadPrec [LineHeight] | |
| Show LineHeight | |
Defined in Data.Text.ParagraphLayout.Internal.LineHeight Methods showsPrec :: Int -> LineHeight -> ShowS show :: LineHeight -> String showList :: [LineHeight] -> ShowS | |
data ParagraphOptions #
Instances
| Eq ParagraphOptions | |
Defined in Data.Text.ParagraphLayout.Internal.ParagraphOptions Methods (==) :: 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
Constructors
| InlineBox d (Box t d) BoxOptions | |
| TextSequence d t |
Constructors
| Box [InnerNode t d] TextOptions |
data BoxOptions #
Instances
| Eq BoxOptions | |
data TextOptions #
Instances
| Eq TextOptions | |
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 #
Constructors
| ParagraphLayout | |
Fields
| |
Instances
Constructors
| Fragment | |
Fields
| |
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 #
Constructors
| AncestorBox | |
Fields
| |
Instances
| Eq d => Eq (AncestorBox d) | |
| Read d => Read (AncestorBox d) | |
Defined in Data.Text.ParagraphLayout.Internal.AncestorBox Methods 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 Methods showsPrec :: Int -> AncestorBox d -> ShowS show :: AncestorBox d -> String showList :: [AncestorBox d] -> ShowS | |
Constructors
| NoEdge | |
| SpacedEdge Int32 |