Rule Procedure Type Definitions
Computes bounding box for an atom with specified value & style
AtomBoxProc: TYPE ~
PROC[value: ROPE, style: Style] RETURNS[ImagerFont.Extents];
Paints an Atom onto Imager context
AtomPaintProc: TYPE ~
PROC[value: ROPE, style: Style, context: Imager.Context, absBox: BOX];
Adjusts bounding boxes for arguments & symbols by satisfying constraints
Returned Boxes use Relative Units
CompoundBoxProc: TYPE ~
PROC[boxes: LIST OF BOX] RETURNS[LIST OF BOX];
Composes Layout by satisfying spacing and alignment constraints
CompositionProc: TYPE ~
PROC[boxes: LIST OF BOX] RETURNS[BOX, LIST OF BOX];
Returns a rope from atom value
AtomToASRopeProc: TYPE ~ PROC[value: ROPE] RETURNS[ROPE];
Size Type Definitions
Size: TYPE ~ {normal, script, scriptscript, big};
Alignment Operations
AlignHorizontal:
PROC[box1: ImagerFont.Extents, offset1: Offset, box2:
BOX, offset2: Offset]
RETURNS[
REAL];
effects: Horizontally aligns box1 with box2 using specified offsets.
Returns x offset for box1.
AlignVertical:
PROC[box1: ImagerFont.Extents, offset1: Offset, box2:
BOX, offset2: Offset]
RETURNS[
REAL];
effects: Vertically aligns box1 with box2 using specified offsets.
Returns y offset for box1.
Automated Layout Composition
Compose:
PROC[boxes:
LIST
OF
BOX, alignments:
LIST
OF Alignment2D, hOrigin, vOrigin: TaggedOffset]
RETURNS[
BOX,
LIST
OF
BOX];
effects: Performs the layout composition for boxes using alignments.
Returns information expected from a CompositionProc.
ComposeMatrix:
PROC[nRows, nCols:
NAT, boxes:
LIST
OF
BOX, spaceBox, openSymBox, closeSymBox:
BOX]
RETURNS[
BOX,
LIST
OF
BOX,
BOX,
BOX];
effects: Performs the layout composition for a generalized matrix.
Returns information expected by Format, preserving input row&col orderings.
RowColFromAtom:
PROC[rc:
ATOM]
RETURNS[
NAT,
NAT];
requires: rc is of the form $r#c#
effects: Returns the row and column indexes associated with $r#c#
SIGNALS badFormat if rc does not conform to the format $r#c#
AtomFromRowCol:
PROC[row, col:
NAT]
RETURNS[
ATOM];
effects: Returns the atom $r{row}c{col}