-- AltoFont.mesa
-- Last changed by Doug Wyatt, September 9, 1980 4:08 PM
DIRECTORY
Font USING [Id];
AltoFont: DEFINITIONS = {
Handle: TYPE = LONG POINTER TO Object;
New: PROC[id: Font.Id, size: CARDINAL] RETURNS[Handle];
Default: PROC RETURNS[Handle];
BBox: TYPE = RECORD [
dx,dy: CARDINAL,
ox,oy: INTEGER,
wx,wy: INTEGER
];
Rast: TYPE = RECORD [
bca: LONG POINTER, bmr: CARDINAL,
x0,y0: INTEGER
];
Character: PROC[self: Handle, c: CHARACTER,
bbox: POINTER TO BBox, rast: POINTER TO Rast] = INLINE {
self.procs.Character[self,c,bbox,rast]
};
CharBox: PROC[self: Handle, c: CHARACTER] RETURNS[bbox: BBox] = INLINE {
self.procs.CharBox[self,c,@bbox]
};
StringBox: PROC[self: Handle, s: LONG STRING] RETURNS[bbox: BBox] = INLINE {
self.procs.StringBox[self,s,@bbox]
};
FontBox: PROC[self: Handle] RETURNS[bbox: BBox] = INLINE {
self.procs.FontBox[self,@bbox]
};
Free: PROC[selfPtr: LONG POINTER TO Handle] = INLINE {
IF selfPtr↑#NIL THEN selfPtr↑.procs.Free[selfPtr]
};
Object: PRIVATE TYPE = RECORD [
procs: LONG POINTER TO READONLY Procs,
data: LONG POINTER TO Data
];
Procs: PRIVATE TYPE = RECORD [
Character: PROC[self: Handle, c: CHARACTER,
bbox: POINTER TO BBox, rast: POINTER TO Rast],
CharBox: PROC[self: Handle, c: CHARACTER,
bbox: POINTER TO BBox],
StringBox: PROC[self: Handle, s: LONG STRING,
bbox: POINTER TO BBox],
FontBox: PROC[self: Handle,
bbox: POINTER TO BBox],
Free: PROC[selfPtr: LONG POINTER TO Handle]
];
Data: PRIVATE TYPE;
AltoFontImpl: PROGRAM;
}.