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, fontAnyData: REF ]; Create: PROC RETURNS [FontCache]; GetFontCode: PROC [fontObjectRep: FontObjectRep] RETURNS [fontCode: FontCode]; GetCharData: PROC [fontCache: FontCache, fontCode: FontCode, charCode: CARDINAL] RETURNS [charData: REF]; GetStringData: PROC [action: PROC [charCode: CARDINAL, charData: REF], fontCache: FontCache, fontCode: FontCode, ropeOrRefText: REF, start: INT _ 0, length: INT _ LAST[INT]]; GetNSStringData: PROC [action: PROC [charCode: CARDINAL, charData: REF], 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 Michael Plass, September 26, 1983 10:12 am 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 string. 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™™*J™–—Iunitšœฯkœ˜*Kšœ œœ˜#Jšœœ˜Kšœ œœ˜Jšœ œœ˜%š œœœ œœ˜0Jšฯc\™\šฯn œœœ˜9Jšœ œœ˜)JšœJ™JJšœO™OJšœ.™.—šœœ˜Jšœ)™)—šœœ˜J™—šœ ˜Jšœ9™9—Jšœ˜—šŸœœœ ˜!J™—KšŸ œœ œ˜NšŸ œœ6œ˜PJšœ œ˜Jšœœ8™R—šŸ œœ œ œ œ<œ œœœœ˜ฎJšœœ-™GJ™7—š Ÿœœ œ œ œ<œ˜‡Jšœ็™็—šŸœœœ˜BJšœ ™ JšŸœœ˜—š Ÿœœ œ.œ œœ˜vJšœVœ™[J™7—Kšœ˜—…—j f