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

Safe HaskellSafe
LanguageHaskell2010

Graphics.Rendering.MiniTypeset.Document

Contents

Description

The document type, which expresses the intent of the user about what to render.

We support general layouting / formatting, and also constructions specific to mathematical documents (similar to LaTeX).

TODO: mathemetical accents, compound symbols, user-defined styles, squiggly underlines, etc

Synopsis

The document data type

data Document ident Source #

This data type describes what the user want to render.

The type parameter ident is used when the user want to know positions (bounding boxes) of different parts of the rendered text. It must have an Ord instance.

Constructors

Symbol !Char

a single character or symbol

String !String

a string

Space

a space character (do we need this to be separate?)

HorzCat !VAlign [Document ident]

horizontal concatenation

VertCat !HAlign [Document ident]

vertical concatenation

Overlay !(HAlign, VAlign) [Document ident]

overlaying on the top of each other

SubSupScript !(SubSup ident) !(Document ident)

add subscript and/or superscript

Delimited !Delimiter [Document ident]

automatically sized (when possible) delimiters

Fraction !Bool !(Document ident) !(Document ident)

fractions (the Bool signifies whether to draw the line)

AboveBelow !(AboveBelow ident) !(Document ident)

above/below (like in a summation or limit)

WithColor !Col !(Document ident)

change color

WithStyle !BasicStyle !(Document ident)

change font family

Decorated !TextDecoration !(Document ident)

add text decoration

AddMargin !Margin !(Document ident)

an extra margin around the document fragment

Realign !WhichQuad !(Document ident)

change the alignment box

Trim !(Document ident)

trim the outer & gap boxes to the bounding box

RePosition !Pos !(Document ident)

offset (mostly for internal usage)

UnsafeResize !(Double, Double) !(Document ident)

temporary hack for internal usage, DO NOT USE IT!

Identified !ident !(Document ident)

user identifier so that the layout engine can return position information

EmptyDoc

the empty document

Instances
Eq ident => Eq (Document ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

(==) :: Document ident -> Document ident -> Bool #

(/=) :: Document ident -> Document ident -> Bool #

Ord ident => Ord (Document ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

compare :: Document ident -> Document ident -> Ordering #

(<) :: Document ident -> Document ident -> Bool #

(<=) :: Document ident -> Document ident -> Bool #

(>) :: Document ident -> Document ident -> Bool #

(>=) :: Document ident -> Document ident -> Bool #

max :: Document ident -> Document ident -> Document ident #

min :: Document ident -> Document ident -> Document ident #

Show ident => Show (Document ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

showsPrec :: Int -> Document ident -> ShowS #

show :: Document ident -> String #

showList :: [Document ident] -> ShowS #

IsString (Document ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

fromString :: String -> Document ident #

data SubSup ident Source #

A subscript or a superscript, or both

Constructors

Subscript !(Document ident) 
Superscript !(Document ident) 
SubAndSupscript !(Document ident) !(Document ident)

first is the subscript, second the superscript

Instances
Eq ident => Eq (SubSup ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

(==) :: SubSup ident -> SubSup ident -> Bool #

(/=) :: SubSup ident -> SubSup ident -> Bool #

Ord ident => Ord (SubSup ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

compare :: SubSup ident -> SubSup ident -> Ordering #

(<) :: SubSup ident -> SubSup ident -> Bool #

(<=) :: SubSup ident -> SubSup ident -> Bool #

(>) :: SubSup ident -> SubSup ident -> Bool #

(>=) :: SubSup ident -> SubSup ident -> Bool #

max :: SubSup ident -> SubSup ident -> SubSup ident #

min :: SubSup ident -> SubSup ident -> SubSup ident #

Show ident => Show (SubSup ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

showsPrec :: Int -> SubSup ident -> ShowS #

show :: SubSup ident -> String #

showList :: [SubSup ident] -> ShowS #

subSupDocs :: SubSup ident -> (Document ident, Document ident) Source #

data AboveBelow ident Source #

Limits of summations and similar things.

Constructors

Above !(Document ident) 
Below !(Document ident) 
AboveAndBelow !(Document ident) !(Document ident)

first is the above, second is below

Instances
Eq ident => Eq (AboveBelow ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

(==) :: AboveBelow ident -> AboveBelow ident -> Bool #

(/=) :: AboveBelow ident -> AboveBelow ident -> Bool #

Ord ident => Ord (AboveBelow ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

compare :: AboveBelow ident -> AboveBelow ident -> Ordering #

(<) :: AboveBelow ident -> AboveBelow ident -> Bool #

(<=) :: AboveBelow ident -> AboveBelow ident -> Bool #

(>) :: AboveBelow ident -> AboveBelow ident -> Bool #

(>=) :: AboveBelow ident -> AboveBelow ident -> Bool #

max :: AboveBelow ident -> AboveBelow ident -> AboveBelow ident #

min :: AboveBelow ident -> AboveBelow ident -> AboveBelow ident #

Show ident => Show (AboveBelow ident) Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.Document

Methods

showsPrec :: Int -> AboveBelow ident -> ShowS #

show :: AboveBelow ident -> String #

showList :: [AboveBelow ident] -> ShowS #

aboveBelowDocs :: AboveBelow ident -> (Document ident, Document ident) Source #

Atomic documents

space :: Document a Source #

A normal space

zeroWidthSpace :: Document a Source #

A zero-width space (hopefully your chosen unicode font supports it)

Document combinators

(<|>) :: Document a -> Document a -> Document a Source #

Horizontal concatenation

(<->) :: Document a -> Document a -> Document a Source #

Vertical concatenation

(<#>) :: Document a -> Document a -> Document a Source #

Overlay

hcat :: [Document a] -> Document a Source #

Horizontal concatenation of several document fragments

vcat :: [Document a] -> Document a Source #

Vertical concatenation of several document fragments

overlay :: [Document a] -> Document a Source #

Overlay of several document fragments on top of each other

Subscript and superscript

Above and below

above :: Document a -> Document a -> Document a Source #

Used for "big" mathematical operators (like summation)

Fractions and delimiters

choose :: Document a -> Document a -> Document a Source #

"n choose k" notation

delimiteds :: Delimiter -> [Document a] -> Document a Source #

Puts a matched vertical line between the parts

Text decoration

Font variations

Colors

Margins