Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Helper functions to text related operations in widgets.
Synopsis
- getTextMetrics :: WidgetEnv s e -> StyleState -> TextMetrics
- getTextSize :: WidgetEnv s e -> StyleState -> Text -> Size
- getTextSize_ :: WidgetEnv s e -> StyleState -> TextMode -> TextTrim -> Maybe Double -> Maybe Int -> Text -> Size
- getSingleTextLineRect :: WidgetEnv s e -> StyleState -> Rect -> AlignTH -> AlignTV -> Text -> Rect
- getTextGlyphs :: WidgetEnv s e -> StyleState -> Text -> Seq GlyphPos
Documentation
getTextMetrics :: WidgetEnv s e -> StyleState -> TextMetrics Source #
Returns the text metrics of the active style.
getTextSize :: WidgetEnv s e -> StyleState -> Text -> Size Source #
Returns the size of the text using the active style and default options.
:: WidgetEnv s e | The widget environment. |
-> StyleState | The active style. |
-> TextMode | Whether to use single or multi line. |
-> TextTrim | Whether to trim spacers or keep them. |
-> Maybe Double | Maximum width (required for multi line). |
-> Maybe Int | Max lines. |
-> Text | Text to measure. |
-> Size | The calculated size. |
Returns the size of the text using the active style.
getSingleTextLineRect Source #
:: WidgetEnv s e | The widget environment. |
-> StyleState | The active style. |
-> Rect | The bounding rect. |
-> AlignTH | The horizontal alignment. |
-> AlignTV | The vertical alignment. |
-> Text | The text to measure. |
-> Rect | The used rect. May be larger than the bounding rect. |
Returns the rect a single line of text needs to be displayed completely.
getTextGlyphs :: WidgetEnv s e -> StyleState -> Text -> Seq GlyphPos Source #
Returns the glyphs of a single line of text.