VFontsImpl.mesa; Written by S. McGregor
Last Edited by McGregor, July 21, 1983 10:53 am
Michael Plass, August 16, 1983 9:19 am
DIRECTORY
ImagerTransform USING [Scale],
RefText USING [Append, New],
Rope USING [ROPE],
RopeInline USING [InlineFlatten],
UnifiedFonts USING [Create],
VFonts;
VFontsImpl: CEDAR MONITOR
IMPORTS ImagerTransform, RefText, RopeInline, UnifiedFonts
EXPORTS VFonts = BEGIN
prefix: REF TEXT = "Xerox/PressFonts/";
postfix: REF TEXT ← "/MRR";
scratch: REF TEXT ← RefText.New[100];
EstablishFont: PUBLIC ENTRY PROC [family: Rope.ROPE, size: CARDINAL, bold, italic: BOOLFALSE, defaultOnFailure: BOOLTRUE] RETURNS [VFonts.Font] = BEGIN
scratch.length ← prefix.length;
TRUSTED {RefText.Append[scratch, LOOPHOLE[RopeInline.InlineFlatten[family]]]};
postfix[1] ← IF bold THEN 'B ELSE 'M;
postfix[2] ← IF italic THEN 'I ELSE 'R;
RefText.Append[scratch, postfix];
RETURN[UnifiedFonts.Create[scratch, ImagerTransform.Scale[size, size], $Screen]];
END;
defaultFont: PUBLIC VFonts.Font;
RefText.Append[scratch, prefix];
defaultFont ← EstablishFont["Tioga", 10];
END.