DIRECTORY Rope USING [ROPE]; ImagerFontCache: CEDAR DEFINITIONS ~ BEGIN FontCache: TYPE ~ REF FontCacheRep; FontCacheRep: TYPE; FontCode: TYPE ~ CARDINAL; FontObject: TYPE ~ REF FontObjectRep; FontObjectRep: TYPE ~ MACHINE DEPENDENT RECORD [ CharDataProc: PROC [self: FontObject, charCode: CARDINAL] RETURNS [charData: REF, memoryCost: INT], r0, r1, r2, r3, r4, r5: REAL, fontScalarData: INT _ 0, fontAnyData: REF _ NIL ]; Create: PROC RETURNS [FontCache]; GetFontCode: PROC [fontObjectRep: FontObjectRep] RETURNS [fontCode: FontCode]; GetCharData: PROC [fontCache: FontCache, fontCode: FontCode, charCode: CARDINAL] RETURNS [charData: REF]; CharAction: TYPE ~ PROC[charCode: CARDINAL, charData: REF] RETURNS[quit: BOOL _ FALSE]; GetTextData: PROC [action: CharAction, fontCache: FontCache, fontCode: FontCode, text: REF READONLY TEXT, start: NAT _ 0, length: NAT _ NAT.LAST]; GetRopeData: PROC [action: CharAction, fontCache: FontCache, fontCode: FontCode, rope: Rope.ROPE, start: INT _ 0, length: INT _ INT.LAST]; GetNSStringData: PROC [action: CharAction, fontCache: FontCache, fontCode: FontCode, ropeOrRefText: REF]; InterpretFontCode: PROC [fontCode: FontCode] RETURNS [FontObject]; InvalidFontCode: ERROR; EnumerateFontCodes: PROC [action: PROC [fontCode: FontCode, fontObject: FontObject] RETURNS [flush: BOOLEAN _ FALSE]]; END. ÔImagerFontCache.mesa Copyright c 1984 Xerox Corporation. All rights reserved. Michael Plass, September 26, 1983 10:12 am Doug Wyatt, July 20, 1984 1:51:10 pm PDT This interface provides a mechanism for caching device- or resolution-dependent representations (of characters, for example) that are derived from some device-independent representation. The cached representations are automatically flushed when the font package deems it appropriate to do so, based on how much they have been used recently, how expensive they are to create, and how much storage they use. Machine dependent to make sure there are no unused bits in the record, so hashing will work. charCode is a character code (but not resticted to 8 bits by this package) charData is the device-dependent character representation desired by the client memoryCost is a hint to the font cache manager may be used to represent a transformation For client use For client use; should be canonicalized for best results. Makes a new font cache. For getting the cached REF data associated with a given character in a given font. For getting the cached REFs associated with each character in a REF TEXT. Warning: the action proc is called inside of a monitor. For getting the cached REFs associated with each character in a ROPE. Warning: the action proc is called inside of a monitor. Like GetStringData, but the string is encoded using the Interpress string-body encoding, i.e., a character of '\377 is treated as an escape code that precedes a byte containing the high-order 8 bits of a new character code offset. May raise: Enumerates all valid font codes, making invalid any for which the action proc returns TRUE. Warning: the action proc is called inside of a monitor. Ê¿˜™Jšœ Ïmœ.™9J™*J™(—J™J™–J˜šÏk ˜ šœžœžœ˜J˜——Jšœž˜"Jšœž˜J˜Jšœ žœžœ˜#šœžœ˜J˜—šœ žœžœ˜J˜—Jšœ žœžœ˜%š œžœžœž œžœ˜0JšÏc\™\šÏn œžœžœ˜9Jšžœ žœžœ˜)JšœJ™JJšœO™OJšœ.™.—šœžœ˜Jšœ)™)—šœžœ˜J™—šœ žœž˜Jšœ9™9—Jšœ˜J˜—š œžœžœ ˜!J™J™—š  œžœ žœ˜NJ˜—š  œžœ6žœ˜PJšžœ žœ˜Jšœžœ8™RJ™—šœ žœžœ žœ žœžœžœžœ˜WJ˜—š  œžœ?˜PJšœžœžœžœ žœžœžœžœ˜AJšœI™IJ™7J™—š  œžœ?˜PJš œ žœ žœžœžœžœ˜9JšœE™EJ™7J™—š œžœ?˜TJšœžœ˜Jšœç™çJ™—š œžœžœ˜BJšœ ™ Jš œžœ˜J˜—š  œžœ žœ.žœ žœžœ˜vJšœVžœ™[J™7J™—Jšžœ˜—…—D×