| Portability | non-portable (requires concurrency) |
|---|---|
| Stability | provisional |
| Maintainer | libraries@haskell.org |
| Safe Haskell | None |
Graphics.HGL.Draw.Text
Contents
Description
Drawing text.
- text :: Point -> String -> Graphic
- textInfo :: String -> Draw (Point, Size)
- data RGB = RGB Word8 Word8 Word8
- setTextColor :: RGB -> Draw RGB
- setBkColor :: RGB -> Draw RGB
- data BkMode
- = Opaque
- | Transparent
- setBkMode :: BkMode -> Draw BkMode
- type Alignment = (HAlign, VAlign)
- data HAlign
- data VAlign
- setTextAlignment :: Alignment -> Draw Alignment
Drawing text
Color
A color, comprising red, green and blue components.
setTextColor :: RGB -> Draw RGBSource
Set the foreground color for drawing text, returning the previous value.
setBkColor :: RGB -> Draw RGBSource
Set the background color for drawing text, returning the previous value.
The background color is ignored when the mode is Transparent.
Background mode for drawing text.
Constructors
| Opaque | Draw text on a bounding rectangle filled with the current background color. |
| Transparent | Draw text without a background rectangle. |
setBkMode :: BkMode -> Draw BkModeSource
Set the background mode for drawing text, returning the previous value.
Alignment
type Alignment = (HAlign, VAlign)Source
How strings drawn with text are positioned
relative to the specified reference point.
Horizontal alignment of text. Names have a tick to distinguish them from Prelude names.
Vertical alignment of text.
setTextAlignment :: Alignment -> Draw AlignmentSource
Set the alignment for drawing text, returning the previous value.