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

PortabilityGHC with TypeFamilies and more
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>



Querying the Drawing Context.



withTextAttr :: (RGBi -> FontAttr -> a) -> DrawingF aSource

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

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

monoLowerxHeight :: FromPtSize u => DrawingF uSource

Height of a lower case 'x' in Courier.

'x' has no ascenders or descenders.

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