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