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
- getRoundCornerSize :: (DrawingCtxM m, Fractional u, FromPtSize u) => m u
- getTextMargin :: (DrawingCtxM m, Fractional u, FromPtSize u) => m (u, u)
- getLineWidth :: DrawingCtxM m => m Double
- getFontAttr :: DrawingCtxM m => m FontAttr
- getFontSize :: DrawingCtxM m => m Int
- getFontFace :: DrawingCtxM m => m FontFace
- markHeight :: (DrawingCtxM m, FromPtSize u) => m u
- markHalfHeight :: (DrawingCtxM m, Fractional u, FromPtSize u) => m u
- baselineSpacing :: (DrawingCtxM m, Fractional u) => m u
- glyphBoundingBox :: (FromPtSize u, DrawingCtxM m) => m (BoundingBox u)
- glyphHeightRange :: (FromPtSize u, DrawingCtxM m) => m (u, u)
- glyphHeight :: (FromPtSize u, DrawingCtxM m) => m u
- glyphCapHeight :: (FromPtSize u, DrawingCtxM m) => m u
- cwLookupTable :: (FromPtSize u, DrawingCtxM m) => m (CharWidthTable u)
- monoFontPointSize :: (DrawingCtxM m, FromPtSize u) => m u
- monoCharWidth :: (DrawingCtxM m, FromPtSize u) => m u
- monoTextWidth :: (DrawingCtxM m, FromPtSize u) => Int -> m u
- monoTextLength :: (DrawingCtxM m, FromPtSize u) => String -> m u
- monoCapHeight :: (DrawingCtxM m, FromPtSize u) => m u
- monoLowerxHeight :: (DrawingCtxM m, FromPtSize u) => m u
- monoDescenderDepth :: (DrawingCtxM m, FromPtSize u) => m u
- monoAscenderHeight :: (DrawingCtxM m, FromPtSize u) => m u
- monoTextDimensions :: (DrawingCtxM m, Num u, Ord u, FromPtSize u) => String -> m (u, u)
- monoMultiLineHeight :: (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
getRoundCornerSize :: (DrawingCtxM m, Fractional u, FromPtSize u) => m uSource
Vertical distance between baselines of consecutive text lines.
getTextMargin :: (DrawingCtxM m, Fractional u, FromPtSize u) => m (u, u)Source
Vertical distance between baselines of consecutive text lines.
getLineWidth :: DrawingCtxM m => m DoubleSource
getFontAttr :: DrawingCtxM m => m FontAttrSource
getFontSize :: DrawingCtxM m => m IntSource
getFontFace :: DrawingCtxM m => m FontFaceSource
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.
Glyph metrics
glyphBoundingBox :: (FromPtSize u, DrawingCtxM m) => m (BoundingBox u)Source
glyphHeightRange :: (FromPtSize u, DrawingCtxM m) => m (u, u)Source
glyphHeight :: (FromPtSize u, DrawingCtxM m) => m uSource
glyphCapHeight :: (FromPtSize u, DrawingCtxM m) => m uSource
cwLookupTable :: (FromPtSize u, DrawingCtxM m) => m (CharWidthTable u)Source
Default monospace metrics
monoFontPointSize :: (DrawingCtxM m, FromPtSize u) => m uSource
monoCharWidth :: (DrawingCtxM m, FromPtSize u) => m uSource
monoTextWidth :: (DrawingCtxM m, FromPtSize u) => Int -> m uSource
monoTextLength :: (DrawingCtxM m, FromPtSize u) => String -> m uSource
monoCapHeight :: (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
monoAscenderHeight :: (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.
monoMultiLineHeight :: (DrawingCtxM m, Fractional u, FromPtSize u) => Int -> m uSource
The heigth of n
lines of text, which is
n lines + n-1 line spacers
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