Module

BetaCalendars.GridAlgebra.Paper

Package
purescript-betacalendars-grid-algebra
Repository
mateopedersen/purescript-betacalendars-grid-algebra

Nominal paper dimensions and checked printable-grid geometry.

All measurements use millimeters. The output describes a geometric model with explicit reserved areas; it does not claim to measure a printer or a person's writing experience. Project context: Beta Calendars. Example references: blank, January, April, July, and October.

#Millimeters Source

newtype Millimeters

A non-negative, finite millimeter measurement.

Instances

#millimeters Source

millimeters :: Number -> Maybe Millimeters

Construct a non-negative finite millimeter value.

#millimeterValue Source

millimeterValue :: Millimeters -> Number

Read the numeric millimeter measurement.

#PaperSize Source

data PaperSize

Standard ISO and US paper formats, or a custom width and height.

Constructors

Instances

#Orientation Source

data Orientation

Page orientation.

Constructors

Instances

#Margins Source

type Margins = { bottom :: Millimeters, left :: Millimeters, right :: Millimeters, top :: Millimeters }

Four non-negative page margins.

#LayoutSpec Source

type LayoutSpec = { columns :: Int, margins :: Margins, notesHeight :: Millimeters, orientation :: Orientation, paper :: PaperSize, rows :: Int, titleHeight :: Millimeters, weekdayHeaderHeight :: Millimeters }

Input parameters for a printable grid model.

#LayoutMetrics Source

type LayoutMetrics = { cellArea :: Number, cellHeight :: Millimeters, cellWidth :: Millimeters, gridHeight :: Millimeters, gridWidth :: Millimeters, pageHeight :: Millimeters, pageWidth :: Millimeters, printableHeight :: Millimeters, printableWidth :: Millimeters, writingArea :: Number }

Derived page and cell geometry.

#LayoutError Source

data LayoutError

Failures that prevent a physically meaningful grid calculation.

Constructors

Instances

#paperDimensions Source

paperDimensions :: PaperSize -> Orientation -> { height :: Number, width :: Number }

Dimensions in the requested orientation. Letter and Legal are the US nominal dimensions in millimeters.

#layoutMetrics Source

layoutMetrics :: LayoutSpec -> Either LayoutError LayoutMetrics

Calculate layout geometry after validating all reserved areas and shape.

#defaultMargins Source

defaultMargins :: Margins

Common model margins used in examples: 10 mm on each side.