VFonts.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last Edited by McGregor, September 1, 1982 2:37 pm
Last Edited by: Maxwell, January 3, 1983 12:12 pm
Doug Wyatt, March 29, 1985 2:20:40 pm PST
DIRECTORY
ImagerFont USING [Font],
Rope USING [ROPE];
VFonts: CEDAR DEFINITIONS
~ BEGIN
Font: TYPE ~ ImagerFont.Font;
ROPE: TYPE ~ Rope.ROPE;
defaultFont: Font;
DefaultFont: PROC [font: Font ← NIL] RETURNS [Font]
~ INLINE { RETURN[IF font=NIL THEN defaultFont ELSE font] };
EstablishFont: PUBLIC PROC [family: ROPE, size: CARDINAL,
bold: BOOLFALSE, italic: BOOLFALSE, defaultOnFailure: BOOLTRUE
] RETURNS [Font];
Build a (possibly) new font. The default font will be returned on any error condition unless defaultOnFailure is FALSE.
CharWidth: PROC [char: CHAR, font: Font ← NIL] RETURNS [NAT];
StringWidth: PROC [string: ROPE, font: Font ← NIL] RETURNS [NAT];
FontHeight: PROC [font: Font ← NIL] RETURNS [NAT];
FontAscent: PROC [font: Font ← NIL] RETURNS [NAT];
Error: ERROR [code: ErrorCode];
ErrorCode: TYPE ~ {illegalFormat, fontNotFound};
END.