XFontCache.mesa
Michael Plass, May 5, 1983 11:22 am
XFontCache: CEDAR DEFINITIONS ~ BEGIN
FontCache: TYPE ~ REF FontCacheRep;
FontCacheRep: TYPE;
FontCode: TYPE ~ RECORD [key: CARDINAL];
Create:
PROC
RETURNS [FontCache];
Makes a new font cache.
GetFontCode:
PROC [a, b, c, d:
REAL, font:
REF]
RETURNS [FontCode];
Makes a new font code. FontCodes are unique across all FontCaches. The real numbers may be used to represent a transformation, and the REF may be used to point to your favorite representation of the font.
InterpretFontCode:
PROC [fontCode: FontCode]
RETURNS [a, b, c, d:
REAL, font:
REF];
Makes a new font code. FontCodes are unique across all FontCaches. The real numbers may be used to represent a transformation, and the REF may be used to point to your favorite representation of the font. May raise:
InvalidFontCode: ERROR;
Flush:
PROC [font:
REF];
Invalidates all FontCodes that refer to the given REF. Do this when you would like to get rid of unneeded font REFs.
GetCharData:
PROC [fontCache: FontCache, fontCode: FontCode, char:
CHAR]
RETURNS [
REF];
For getting the REF data associated with a given character in a given font. If the REF is not present, will raise the following signal:
CacheMiss: SIGNAL [fontCode: FontCode, char: CHAR] RETURNS [data: REF];
LoadCharData:
PROC [fontCache: FontCache, fontCode: FontCode, char:
CHAR, data:
REF];
For preloading the cache.
END.