|
Graphics.HGL.Draw.Text | Portability | non-portable (requires concurrency) | Stability | provisional | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
Drawing text.
|
|
Synopsis |
|
|
|
|
Drawing text
|
|
text :: Point -> String -> Graphic |
Render a String positioned relative to the specified Point.
|
|
textInfo :: String -> Draw (Point, Size) |
textInfo s returns:
- The offset at which the string would be drawn according to the
current text alignment (e.g., (Center, Baseline) will result
in an offset of (-width/2,0))
- The size at which the text would be drawn using the current font.
|
|
Color
|
|
data RGB |
A color, comprising red, green and blue components.
| Constructors | |
|
|
setTextColor :: RGB -> Draw RGB |
Set the foreground color for drawing text, returning the previous value.
|
|
setBkColor :: RGB -> Draw RGB |
Set the background color for drawing text, returning the previous value.
The background color is ignored when the mode is Transparent.
|
|
data BkMode |
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 BkMode |
Set the background mode for drawing text, returning the previous value.
|
|
Alignment
|
|
type Alignment = (HAlign, VAlign) |
How strings drawn with text are positioned
relative to the specified reference point.
|
|
data HAlign |
Horizontal alignment of text.
Names have a tick to distinguish them from Prelude names.
| Constructors | Left' | align the left edge of the text with the reference point
| Center | center the text with the reference point
| Right' | align the right edge of the text with the reference point
|
| Instances | |
|
|
data VAlign |
Vertical alignment of text.
| Constructors | Top | align the top edge of the text with the reference point
| Baseline | align the baseline of the text with the reference point
| Bottom | align the bottom edge of the text with the reference point
|
| Instances | |
|
|
setTextAlignment :: Alignment -> Draw Alignment |
Set the alignment for drawing text, returning the previous value.
|
|
Produced by Haddock version 0.8 |