hps-0.11: Haskell Postscript

Graphics.PS.Paper

Description

Paper sizes. For ISO sizes see http://www.cl.cam.ac.uk/~mgk25/iso-paper.html.

Synopsis

Documentation

data Paper Source

Paper size data type.

Constructors

Paper 

Fields

width :: Int
 
height :: Int
 

Instances

data BBox Source

BoundingBox for an EPSF file with an optional HiResBoundingBox

Constructors

BBox 

Fields

llx :: Int

lower left x (x-min)

lly :: Int

lower left y (y-min)

urx :: Int

upper right x (x-max)

ury :: Int

upper right y (y-max)

HRBBox 

Fields

llx :: Int

lower left x (x-min)

lly :: Int

lower left y (y-min)

urx :: Int

upper right x (x-max)

ury :: Int

upper right y (y-max)

hrllx :: Double

high resolution llx

hrlly :: Double

high resolution lly

hrurx :: Double

high resolution urx

hrury :: Double

high resolution ury

Instances

landscape :: Paper -> PaperSource

Swap width and height of Paper.

divRound :: Int -> Int -> IntSource

A div variant that rounds rather than truncates.

 let f (Paper _ h) = h `div` 2 == h `divRound` 2
 in all id (map f [b0,b1,b2,b3,b4,b5,b6,b7,b8,b9]) == False

iso_down_scale :: Paper -> PaperSource

ISO size downscaling, ie. from A0 to A1.

 iso_down_scale a4 == a5

a0, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1 :: PaperSource

ISO A sizes in millimeters.

 a4 == Paper 210 297

b0, b10, b9, b8, b7, b6, b5, b4, b3, b2, b1 :: PaperSource

ISO B sizes in millimeters.

 b4 == Paper 250 354

c0, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1 :: PaperSource

ISO C sizes in millimeters.

 c4 == Paper 229 324

usLetter :: PaperSource

US Letter size in millimeters (ie Paper 216 279).

proportion :: Paper -> DoubleSource

Proportion of Paper.

 proportion broadsheet == 1.25
 map (round . (* 1e3) . proportion) [a0,b0,c0] == [1414,1414,1414]
 map proportion [usLetter,berliner,tabloid]