-- Compiler GriffinFontDefs
-- Stone, February 18, 1980  5:02 PM
-- Tiberi January 24, 1980  4:58 PM
-- interface module for griffin fonts

DIRECTORY
	StyleDefs: FROM "StyleDefs",
	PointDefs: FROM "PointDefs";

-- ---------------------------------------------------------------------------------
-- ---------------------------------------------------------------------------------
GriffinFontDefs:  DEFINITIONS =
BEGIN 

-- rotation in minutes, face as in Fonts.Widths
FontDescriptor: TYPE = RECORD [name: STRING, rotation, face, points: CARDINAL]; 
Rot0Degrees: CARDINAL = 0;
Rot90Degrees: CARDINAL = 5400;
Rot180Degrees: CARDINAL = 10800;
Rot270Degrees: CARDINAL = 16200;

Regular: CARDINAL = 0;
Italic: CARDINAL = 1;
Bold: CARDINAL = 2;
BoldItalic: CARDINAL = Bold + Italic;

FontDescriptorHandle: TYPE = POINTER TO FontDescriptor;

ForAllFonts: PROCEDURE[do: PROCEDURE[font: FontDescriptorHandle]];

DisplayString: PROCEDURE [string: STRING,
	screenpt: PointDefs.ScrPt,
	anchor: StyleDefs.Anchor,
	orientation: StyleDefs.Orientation,
	fd: FontDescriptorHandle];

Width, Height: PROCEDURE [c: CHARACTER, fd: FontDescriptorHandle]
	RETURNS [CARDINAL];

StringWidth, StringHeight: PROCEDURE [string: STRING, fd: FontDescriptorHandle, orientation: StyleDefs.Orientation]
	RETURNS [CARDINAL];

MaxWidth, MaxHeight, BaseLine: PROCEDURE [fd: FontDescriptorHandle]
	RETURNS [CARDINAL];

TopLeft: PROCEDURE [anchorPt: PointDefs.ObjPt,
		height, width: CARDINAL,
		anchor: StyleDefs.Anchor,
		orientation: StyleDefs.Orientation,
		rotation: CARDINAL]
	RETURNS [tl: PointDefs.ObjPt];

BltChar: PROCEDURE [char: CHARACTER, tl: PointDefs.ScrPt,
	fd: FontDescriptorHandle];

ReadStrike: PROCEDURE[fp:POINTER, s: STRING] RETURNS[BOOLEAN];

FontError: SIGNAL;
ErrorType: TYPE = {nofonts, nowidths};
StartupFontError: SIGNAL[type: ErrorType];

END.