VFontsImpl.mesa; Written by S. McGregor
Last Edited by McGregor, July 19, 1983 4:09 pm
DIRECTORY
ImagerTransform USING [Scale],
RefText USING [Append, New],
Rope USING [ROPE],
RopeInline USING [InlineFlatten],
UnifiedFonts USING [FONT, Create],
VFonts;
VFontsImpl: CEDAR MONITOR
IMPORTS ImagerTransform, RefText, RopeInline, UnifiedFonts
EXPORTS VFonts = BEGIN
prefix: REF TEXT = "Xerox/PressFonts/";
postfix: REF TEXT ← "/MMR";
scratch: REF TEXT ← RefText.New[100];
GetFont: PUBLIC ENTRY PROC [family: Rope.ROPE, size: CARDINAL, bold, italic: BOOLFALSE, defaultOnFailure: BOOLTRUE] RETURNS [UnifiedFonts.FONT] = BEGIN
scratch.length ← prefix.length;
TRUSTED {RefText.Append[scratch, LOOPHOLE[RopeInline.InlineFlatten[family]]]};
IF bold THEN postfix[1] ← 'B;
IF italic THEN postfix[2] ← 'I;
RefText.Append[scratch, postfix];
RETURN[UnifiedFonts.Create[scratch, ImagerTransform.Scale[size, size], $Screen]];
END;
RefText.Append[scratch, prefix];
END.