Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Querying the Drawing Context.
- textAttr :: (Applicative m, DrawingCtxM m) => m (RGBi, FontAttr)
- withTextAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> FontAttr -> a) -> m a
- strokeAttr :: (Applicative m, DrawingCtxM m) => m (RGBi, StrokeAttr)
- withStrokeAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> StrokeAttr -> a) -> m a
- fillAttr :: (Applicative m, DrawingCtxM m) => m RGBi
- withFillAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> a) -> m a
- borderedAttr :: (Applicative m, DrawingCtxM m) => m (RGBi, StrokeAttr, RGBi)
- withBorderedAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> StrokeAttr -> RGBi -> a) -> m a
- lineWidth :: (Applicative m, DrawingCtxM m) => m Double
- fontSize :: (Applicative m, DrawingCtxM m) => m Int
- markHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- markHalfHeight :: (Applicative m, DrawingCtxM m, Fractional u, FromPtSize u) => m u
- lineSpacing :: (Applicative m, DrawingCtxM m, Fractional u) => m u
- monoCharWidth :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- monoSpacerWidth :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- monoTextWidth :: (Applicative m, DrawingCtxM m, FromPtSize u) => Int -> m u
- monoTextLength :: (Applicative m, DrawingCtxM m, FromPtSize u) => String -> m u
- monoTextHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- monoNumeralHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- monoLowerxHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- monoDescenderDepth :: (Applicative m, DrawingCtxM m, FromPtSize u) => m u
- monoTextDimensions :: (Applicative m, DrawingCtxM m, Num u, Ord u, FromPtSize u) => String -> m (u, u)
- monoVecToCenter :: (Applicative m, DrawingCtxM m, Fractional u, Ord u, FromPtSize u) => String -> m (Vec2 u)
Documentation
textAttr :: (Applicative m, DrawingCtxM m) => m (RGBi, FontAttr)Source
withTextAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> FontAttr -> a) -> m aSource
Because textAttr
is so commonly used here is a functional
version that avoids tupling.
strokeAttr :: (Applicative m, DrawingCtxM m) => m (RGBi, StrokeAttr)Source
withStrokeAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> StrokeAttr -> a) -> m aSource
fillAttr :: (Applicative m, DrawingCtxM m) => m RGBiSource
withFillAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> a) -> m aSource
borderedAttr :: (Applicative m, DrawingCtxM m) => m (RGBi, StrokeAttr, RGBi)Source
withBorderedAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> StrokeAttr -> RGBi -> a) -> m aSource
lineWidth :: (Applicative m, DrawingCtxM m) => m DoubleSource
fontSize :: (Applicative m, DrawingCtxM m) => m IntSource
markHeight :: (Applicative m, 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 :: (Applicative m, DrawingCtxM m, Fractional u, FromPtSize u) => m uSource
lineSpacing :: (Applicative m, DrawingCtxM m, Fractional u) => m uSource
monoCharWidth :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource
monoSpacerWidth :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource
monoTextWidth :: (Applicative m, DrawingCtxM m, FromPtSize u) => Int -> m uSource
monoTextLength :: (Applicative m, DrawingCtxM m, FromPtSize u) => String -> m uSource
monoTextHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource
monoNumeralHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource
monoLowerxHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource
Height of a lower case 'x' in Courier.
'x' has no ascenders or descenders.
monoDescenderDepth :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource
monoTextDimensions :: (Applicative m, 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.
monoVecToCenter :: (Applicative m, DrawingCtxM m, Fractional u, Ord u, FromPtSize u) => String -> m (Vec2 u)Source
Vector from baseline left to center