Init:
PROC [] ~ {
SizeRec: TYPE ~ RECORD [a, b, c, d, e: CARDINAL ← CARDINAL.LAST];
RotRec: TYPE ~ RECORD [a, b, c: CARDINAL ← CARDINAL.LAST];
FaceRec: TYPE ~ RECORD [a, b, c, d: MyFace];
MyFace: TYPE ~ {nil, r, b, i, bi} ← nil;
micasPerPoint: REAL ← 2540/72.0;
Full:
PROC[family:
ROPE, face: MyFace]
RETURNS [
ROPE] ~ {
RETURN [Rope.Cat["xerox/pressfonts/", family, "-", SELECT face FROM r => "mrr", b => "brr", i => "mir", bi => "bir", ENDCASE => ERROR]]
};
Def:
PROC [family:
ROPE, ff: FaceRec, ss: SizeRec, rr: RotRec] ~ {
faces: ARRAY [0..4) OF MyFace ~ [ff.a, ff.b, ff.c, ff.d];
sizes: ARRAY [0..5) OF CARDINAL ~ [ss.a, ss.b, ss.c, ss.d, ss.e];
rotations: ARRAY [0..3) OF CARDINAL ~ [rr.a, rr.b, rr.c];
FOR f:
NAT
IN [0..4)
UNTIL faces[f] = nil
DO
name: ROPE ~ Full[family, faces[f]];
nameAtom: ATOM ~ Atom.MakeAtom[name];
FOR s:
NAT
IN [0..5)
UNTIL sizes[s] =
CARDINAL.
LAST
DO
micas: NAT ~ Real.Round[sizes[s]*micasPerPoint];
FOR r:
NAT
IN [0..3)
UNTIL rotations[r] =
CARDINAL.
LAST
DO
pfd: PressFontDescription ←
NEW[PressFontDescriptionRep ← [
family: family,
face: SELECT faces[f] FROM r => 0, b => 2, i => 1, bi => 3, ENDCASE => ERROR,
rotation: rotations[r]*INT[60], -- in minutes of arc
size: micas,
veryClose: TRUE,
exact: TRUE
]];
fontAtom: FontAtom ~ MakeFontAtom[nameAtom, ImagerTransformation.Scale[micas].PreRotate[rotations[r]]];
[] ← RefTab.Store[tables[press], fontAtom, pfd];
[] ← RefTab.Store[tables[spruce], fontAtom, pfd];
ENDLOOP;
ENDLOOP;
ENDLOOP;
};
DefPress:
PROC [family:
ROPE, ff: FaceRec] ~ {
faces: ARRAY [0..4) OF MyFace ~ [ff.a, ff.b, ff.c, ff.d];
FOR f:
NAT
IN [0..4)
UNTIL faces[f] = nil
DO
name: ROPE ~ Full[family, faces[f]];
nameAtom: ATOM ~ Atom.MakeAtom[name];
pfd: PressFontDescription ←
NEW[PressFontDescriptionRep ← [
family: family,
face: SELECT faces[f] FROM r => 0, b => 2, i => 1, bi => 3, ENDCASE => ERROR,
rotation: 0, -- in minutes of arc
size: 0,
veryClose: TRUE,
exact: TRUE
]];
fontAtom: FontAtom ~ MakeFontAtom[nameAtom, zeroTransformation];
[] ← RefTab.Store[tables[press], fontAtom, pfd];
ENDLOOP;
};
Def["arrows", [r], [10], [0, 90, 270]];
Def["classic", [r, b, i], [6, 7, 8, 9, 10], [0, 90, 270]];
Def["classic", [r, b, i], [11, 12, 14, 18], [0, 90, 270]];
Def["classicpione", [r, b, i], [8, 10, 12], [0, 90, 270]];
Def["gacha", [r, b, i, bi], [5, 6, 7, 8, 9], [0]];
Def["gacha", [r, b, i, bi], [10, 12], [0]];
Def["gacha", [r], [5, 6, 8, 10, 12], [90, 270]];
Def["gates", [r], [10, 12, 18, 32], [0]];
Def["gates", [r], [32], [90, 270]];
Def["helvetica", [r, b, i, bi], [6, 7, 8, 9, 10], [0, 90, 270]];
Def["helvetica", [r, b, i, bi], [11, 12, 14, 18], [0, 90, 270]];
Def["helvetica", [r], [3, 4, 5], [0]];
Def["helvetica", [b], [24, 36], [0, 90, 270]];
Def["helveticad", [r], [24, 30, 36], [0, 90]];
Def["helveticad", [r], [24, 36], [270]];
Def["hippo", [r], [6, 8, 10, 12, 14], [0]];
Def["hippo", [r], [18], [0]];
Def["hippo", [r], [8, 10, 12], [90, 270]];
Def["keyhole", [b], [20], [0, 90, 270]];
Def["keyhole", [r], [20], [0]];
Def["laurel", [r], [10], [0]];
Def["logo", [r], [12, 18, 24], [0, 90, 270]];
Def["math", [r], [6, 8, 10, 12, 14], [0]];
Def["math", [r], [18], [0]];
Def["mockingbird", [r], [24], [0]];
Def["oldenglish", [r], [10, 12, 18, 24, 36], [0]];
Def["oldenglish", [r], [48], [0]];
Def["oldenglish", [r], [18], [90, 270]];
Def["timesromand", [r], [24, 30, 36], [0, 90]];
Def["timesromand", [r], [24, 36], [270]];
Def["template", [r], [10, 12, 18, 64], [0]];
Def["template", [r], [64], [90, 270]];
Def["timesroman", [r, b, i, bi], [6, 7, 8, 9, 10], [0, 90, 270]];
Def["timesroman", [r, b, i, bi], [11, 12, 14, 18], [0, 90, 270]];
Def["timesroman", [r], [4], [0, 90, 270]];
Def["timesroman", [b], [24, 30, 36], [0, 90, 270]];
Def["xeroxbook", [r, b], [10, 12], [0, 90, 270]];
DefPress["arrows", [r]];
DefPress["classic", [r, b, i]];
DefPress["classicpione", [r, b, i]];
DefPress["gacha", [r]];
DefPress["gates", [r]];
DefPress["helvetica", [r, b, i, bi]];
DefPress["hippo", [r]];
DefPress["keyhole", [b]];
DefPress["laurel", [r]];
DefPress["logo", [r]];
DefPress["math", [r]];
DefPress["mockingbird", [r]];
DefPress["oldenglish", [r]];
DefPress["template", [r]];
DefPress["timesroman", [r, b, i, bi]];
DefPress["xeroxbook", [r, b]];
};