DIRECTORY Atom USING [PropList], BasicTime USING [GMT, nullGMT], FS USING [OpenFile], Imager USING [Context], ImagerFont USING [BYTE, CorrectionType, Extents, XChar], Rope USING [ROPE], Vector2 USING [VEC]; ImagerTypeface: CEDAR DEFINITIONS ~ BEGIN VEC: TYPE ~ Vector2.VEC; ROPE: TYPE ~ Rope.ROPE; BYTE: TYPE ~ ImagerFont.BYTE; XChar: TYPE ~ ImagerFont.XChar; CorrectionType: TYPE ~ ImagerFont.CorrectionType; Extents: TYPE ~ ImagerFont.Extents; Typeface: TYPE ~ REF TypefaceRep; TypefaceRep: TYPE ~ RECORD [ class: TypefaceClass, data: REF, name: ROPE _ NIL, created: BasicTime.GMT _ BasicTime.nullGMT, info: InfoTable _ NIL, -- for character set 0 propList: Atom.PropList _ NIL ]; TypefaceClass: TYPE ~ REF TypefaceClassRep; TypefaceClassRep: TYPE ~ RECORD[ type: ATOM, Contains: PROC [self: Typeface, char: XChar] RETURNS [BOOL], NextChar: PROC [self: Typeface, char: XChar] RETURNS [next: XChar], Width: PROC [self: Typeface, char: XChar] RETURNS [VEC], Amplified: PROC [self: Typeface, char: XChar] RETURNS [BOOL], Correction: PROC [self: Typeface, char: XChar] RETURNS [CorrectionType], BoundingBox: PROC [self: Typeface, char: XChar] RETURNS [Extents], FontBoundingBox: PROC [self: Typeface] RETURNS [Extents], Ligature: PROC [self: Typeface, char, successor: XChar] RETURNS [XChar], NextLigature: PROC [self: Typeface, char, successor: XChar] RETURNS [XChar], Kern: PROC [self: Typeface, char, successor: XChar] RETURNS [VEC], NextKern: PROC [self: Typeface, char, successor: XChar] RETURNS [XChar], Mask: PROC [self: Typeface, char: XChar, context: Imager.Context], propList: Atom.PropList _ NIL ]; InfoTable: TYPE ~ REF InfoTableRep; InfoTableRep: TYPE ~ PACKED ARRAY BYTE OF Info; Info: TYPE ~ RECORD [ exists: BOOL _ FALSE, amplified: BOOL _ FALSE, correction: CorrectionType _ none, hasKerns: BOOL _ FALSE, hasLigatures: BOOL _ FALSE, spare1, spare2: BOOL _ FALSE ]; Find: PROC [name: ROPE] RETURNS [Typeface]; CreateProc: TYPE ~ PROC [file: FS.OpenFile] RETURNS [Typeface]; Register: PROC [extension: ROPE, create: CreateProc]; FetchCreator: PROC [extension: ROPE] RETURNS [CreateProc]; GenericCreator: TYPE ~ REF GenericCreatorRep; GenericCreatorRep: TYPE ~ RECORD [ data: REF, proc: GenericCreatorProc, priority: INTEGER _ 0 ]; GenericCreatorProc: TYPE ~ PROC [self: GenericCreator, name: ROPE] RETURNS [Typeface]; RegisterGenericCreator: PROC [genericCreator: GenericCreator]; END. ¨ImagerTypeface.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Doug Wyatt, May 7, 1986 4:40:40 pm PDT Path: PROC [self: Typeface, char: XChar, moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc, curveTo: ImagerPath.CurveToProc, conicTo: ImagerPath.ConicToProc, arcTo: ImagerPath.ArcToProc], Finds the typeface with the specified name. Registers a creation procedure for files with the specified file name extension ("ks", "sd", etc.). Generic creators provide the ability to make typefaces that are a computed function of the name; for example, the name might contain real-valued parameters which determine the shape of the font. The registered genericCreators are called in priority order, each getting a chance to claim the typeface by returning a non-NIL value. In case of a priority clash, the last one registered wins. The normal creation procedure effectively has a priority of 1/2. Κ3˜codešœ™Kšœ Οmœ7™BK™&—K™šΟk ˜ Kšœžœ ˜Kšœ žœžœ ˜Kšžœžœ ˜Kšœžœ ˜Kšœ žœžœ"˜8Kšœžœžœ˜Kšœžœžœ˜—K˜KšΠblœžœž ˜!Kšœž˜K˜Kšžœžœ žœ˜Kšžœžœžœ˜K˜Kšžœžœžœ˜Kšœžœ˜Kšœžœ˜1Kšœ žœ˜#K˜Kšœ žœžœ ˜!šœ žœžœ˜K˜Kšœžœ˜ Kšœžœžœ˜Kšœžœ˜+KšœžœΟc˜-Kšœž˜K˜K˜—Kšœžœžœ˜+šœžœžœ˜!Kšœžœ˜ KšΟnœžœžœžœ˜Kšœΐžœ…™ΘK˜—K˜Kšžœ˜—…— rM