-- JaMFontDesignImpl.mesa -- Mesa 6 version -- Last changed by John Warnock September 17, 1980 2:33 PM DIRECTORY JaMGraphicsDefs, BuildSpline, BuildLine, Graphics, Vector USING [Vec], Cubic USING [Coeffs], JaMFnsDefs USING [GetReal,Register]; JaMFontDesignImpl: PROGRAM IMPORTS JaMFnsDefs,JaMGraphicsDefs,Graphics,BuildSpline,BuildLine = {OPEN JaMFnsDefs,Graphics,BuildSpline,BuildLine; Vec: TYPE = Vector.Vec; Coeffs: TYPE = Cubic.Coeffs; dc: DisplayContext_NIL; Point: TYPE = Graphics.Vec; GetPoint: PROCEDURE[p: POINTER TO Point] = { p.y _ GetReal[]; p.x _ GetReal[]; }; JStartSpline: PROCEDURE = {dc:DisplayContext_JaMGraphicsDefs.GetDC[]; StartSpline[];}; JEnterSPoint: PROCEDURE = { p:Vec; GetPoint[@p]; EnterKnot[p.x,p.y]; }; JEnterSPointSlope: PROCEDURE = { p,s: Point; GetPoint[@s]; GetPoint[@p]; EnterKnotSlope[p.x,p.y,s.x,s.y]; }; JEnterSplineArea: PROCEDURE = { ec:PROCEDURE[cb:Coeffs]= {IF first THEN {first_FALSE; EnterPoint[dc,cb.c0];}; EnterCubic[dc,@cb]}; first:BOOLEAN_TRUE; dc:DisplayContext_JaMGraphicsDefs.GetDC[]; BuildSpline[ec]; }; JEnterCyclicSplineArea: PROCEDURE = { ec:PROCEDURE[cb:Coeffs]= {EnterCubic[dc,@cb]}; dc:DisplayContext_JaMGraphicsDefs.GetDC[]; BuildCyclicSpline[ec]; }; JStartLine:PROCEDURE={ dc:DisplayContext_JaMGraphicsDefs.GetDC[]; StartLine[]; }; JEnterLinePoint:PROCEDURE={ p:Vec; GetPoint[@p]; EnterLineKnot[p.x,p.y]; }; JEnterLinePointSlope:PROCEDURE={ p,s: Point; GetPoint[@s]; GetPoint[@p]; EnterLineKnotSlope[p.x,p.y,s.x,s.y]; }; JEnterLineArea:PROCEDURE={ ec:PROCEDURE[cb:Coeffs]= {IF first THEN {first_FALSE; EnterPoint[dc,cb.c0];}; EnterCubic[dc,@cb]}; first:BOOLEAN_TRUE; dc:DisplayContext_JaMGraphicsDefs.GetDC[]; width:REAL_GetReal[]; BuildLine[width,ec]; }; Register[".startspline"L,JStartSpline]; Register[".enterspoint"L,JEnterSPoint]; Register[".enterspointslope"L,JEnterSPointSlope]; Register[".entersplinearea"L,JEnterSplineArea]; Register[".entercsplinearea"L,JEnterCyclicSplineArea]; Register[".startline"L,JStartLine]; Register[".enterlinepoint"L,JEnterLinePoint]; Register[".enterlinepointslope"L,JEnterLinePointSlope]; Register[".enterlinearea"L,JEnterLineArea]; }.(670)