monomer-1.2.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Util.Text

Description

Helper functions to text related operations in widgets.

Synopsis

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.

getTextSize_ Source #

Arguments

:: 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 #

Arguments

:: 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.