Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Querying the Drawing Context.
- textAttr :: DrawingCtxM m => m (RGBi, FontAttr)
- withTextAttr :: DrawingCtxM m => (RGBi -> FontAttr -> a) -> m a
- strokeAttr :: DrawingCtxM m => m (RGBi, StrokeAttr)
- withStrokeAttr :: DrawingCtxM m => (RGBi -> StrokeAttr -> a) -> m a
- fillAttr :: DrawingCtxM m => m RGBi
- withFillAttr :: DrawingCtxM m => (RGBi -> a) -> m a
- borderedAttr :: DrawingCtxM m => m (RGBi, StrokeAttr, RGBi)
- withBorderedAttr :: DrawingCtxM m => (RGBi -> StrokeAttr -> RGBi -> a) -> m a
- lineWidth :: DrawingCtxM m => m Double
- fontSize :: DrawingCtxM m => m Int
- markHeight :: (DrawingCtxM m, FromPtSize u) => m u
- markHalfHeight :: (DrawingCtxM m, Fractional u, FromPtSize u) => m u
- baselineSpacing :: (DrawingCtxM m, Fractional u) => m u
- monoCharWidth :: (DrawingCtxM m, FromPtSize u) => m u
- monoSpacerWidth :: (DrawingCtxM m, FromPtSize u) => m u
- monoTextWidth :: (DrawingCtxM m, FromPtSize u) => Int -> m u
- monoTextLength :: (DrawingCtxM m, FromPtSize u) => String -> m u
- monoTextHeight :: (DrawingCtxM m, FromPtSize u) => m u
- monoNumeralHeight :: (DrawingCtxM m, FromPtSize u) => m u
- monoLowerxHeight :: (DrawingCtxM m, FromPtSize u) => m u
- monoDescenderDepth :: (DrawingCtxM m, FromPtSize u) => m u
- monoTextDimensions :: (DrawingCtxM m, Num u, Ord u, FromPtSize u) => String -> m (u, u)
- monoMultiLineTextHeight :: (DrawingCtxM m, Fractional u, FromPtSize u) => Int -> m u
- monoDefaultPadding :: (DrawingCtxM m, Fractional u, FromPtSize u) => m u
- monoVecToCenter :: (DrawingCtxM m, Fractional u, Ord u, FromPtSize u) => String -> m (Vec2 u)
Documentation
textAttr :: DrawingCtxM m => m (RGBi, FontAttr)Source
withTextAttr :: DrawingCtxM m => (RGBi -> FontAttr -> a) -> m aSource
Because textAttr
is so commonly used here is a functional
version that avoids tupling.
strokeAttr :: DrawingCtxM m => m (RGBi, StrokeAttr)Source
withStrokeAttr :: DrawingCtxM m => (RGBi -> StrokeAttr -> a) -> m aSource
fillAttr :: DrawingCtxM m => m RGBiSource
withFillAttr :: DrawingCtxM m => (RGBi -> a) -> m aSource
borderedAttr :: DrawingCtxM m => m (RGBi, StrokeAttr, RGBi)Source
withBorderedAttr :: DrawingCtxM m => (RGBi -> StrokeAttr -> RGBi -> a) -> m aSource
lineWidth :: DrawingCtxM m => m DoubleSource
fontSize :: DrawingCtxM m => m IntSource
markHeight :: (DrawingCtxM m, FromPtSize u) => m uSource
The mark height is the height of a lowercase letter in the current font.
Arrowheads, dots etc. should generally be drawn at the mark height.
markHalfHeight :: (DrawingCtxM m, Fractional u, FromPtSize u) => m uSource
baselineSpacing :: (DrawingCtxM m, Fractional u) => m uSource
Vertical distance between baselines of consecutive text lines.
monoCharWidth :: (DrawingCtxM m, FromPtSize u) => m uSource
monoSpacerWidth :: (DrawingCtxM m, FromPtSize u) => m uSource
monoTextWidth :: (DrawingCtxM m, FromPtSize u) => Int -> m uSource
monoTextLength :: (DrawingCtxM m, FromPtSize u) => String -> m uSource
monoTextHeight :: (DrawingCtxM m, FromPtSize u) => m uSource
monoNumeralHeight :: (DrawingCtxM m, FromPtSize u) => m uSource
monoLowerxHeight :: (DrawingCtxM m, FromPtSize u) => m uSource
Height of a lower case 'x' in Courier.
'x' has no ascenders or descenders.
monoDescenderDepth :: (DrawingCtxM m, FromPtSize u) => m uSource
monoTextDimensions :: (DrawingCtxM m, Num u, Ord u, FromPtSize u) => String -> m (u, u)Source
Query the dimensions of the text using the current font size but using metrics derived from Courier.
Note - the width will generally be a over-estimate for non-monospaced fonts.
monoMultiLineTextHeight :: (DrawingCtxM m, Fractional u, FromPtSize u) => Int -> m uSource
monoDefaultPadding :: (DrawingCtxM m, Fractional u, FromPtSize u) => m uSource
The default padding is half of the char width.
monoVecToCenter :: (DrawingCtxM m, Fractional u, Ord u, FromPtSize u) => String -> m (Vec2 u)Source
Vector from baseline left to center