wumpus-basic-0.10.0: Common drawing utilities built on wumpus-core.

PortabilityGHC
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>

Wumpus.Basic.Graphic.Query

Description

Querying the Drawing Context.

Synopsis

Documentation

withTextAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> FontAttr -> a) -> m aSource

Because textAttr is so commonly used here is a functional version that avoids tupling.

withFillAttr :: (Applicative m, DrawingCtxM m) => (RGBi -> a) -> m aSource

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.

monoLowerxHeight :: (Applicative m, DrawingCtxM m, FromPtSize u) => m uSource

Height of a lower case 'x' in Courier.

'x' has no ascenders or descenders.

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