minitypeset-opengl-0.1.0.0: Layout and render text with TrueType fonts using OpenGL

Safe HaskellSafe
LanguageHaskell2010

Graphics.Rendering.MiniTypeset.Box

Description

Boxes are rectangular shapes having a margin and an extra gap between boxes placed next to each other.

A Box has an inner box, and an outer box which is like a margin. The inner boxes are used for relative placement, while the outer boxes determine the extent. Furthermore, extra gaps between boxes placed next to each other are supported.

Boxes has their origin at the top-left corner of their inner box. Absolute boxes (AbsBox) have an extra offset.

We use screen-space coordinate system (Y increase downwards).

Synopsis

Documentation

data Box Source #

A (relative) box

Constructors

Box 

Fields

Instances
Show Box Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Box

Methods

showsPrec :: Int -> Box -> ShowS #

show :: Box -> String #

showList :: [Box] -> ShowS #

data AbsBox Source #

An absolute box

Constructors

AbsBox 

Fields

Instances
Show AbsBox Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Box

Translate AbsBox Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Box

Methods

translate :: Pos -> AbsBox -> AbsBox Source #

hcatBox :: VAlign -> Box -> Box -> (Box, Pos, Pos) Source #

Concatantes two boxes horizontally, using the inner boxes to align them. The two positions we return are relative positions of the two boxes from the origin (top-left inner corner) of the concatenated box.

vcatBox :: HAlign -> Box -> Box -> (Box, Pos, Pos) Source #

Concatantes two boxes vertically, using the inner boxes to align them. The two positions we return are relative positions of the two boxes from the origin (top-left inner corner) of the concatenated box.