DIRECTORY Char USING [XCHAR], ImagerBox USING [Extents], ImagerTransformation USING [Transformation], Rope USING [ROPE], Vector2 USING [VEC]; ImagerFont: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; VEC: TYPE ~ Vector2.VEC; Transformation: TYPE ~ ImagerTransformation.Transformation; XChar: TYPE ~ Char.XCHAR; nullXChar: XChar ~ Char.XCHAR.LAST; XCharProc: TYPE ~ PROC [char: XChar]; XStringProc: TYPE ~ PROC [charAction: XCharProc]; MapRope: PROC [rope: ROPE, start: INT ¬ 0, len: INT ¬ INT.LAST, charAction: XCharProc]; MapText: PROC [text: REF READONLY TEXT, start: NAT ¬ 0, len: NAT ¬ NAT.LAST, charAction: XCharProc]; Font: TYPE ~ REF FontRep; FontRep: TYPE ~ RECORD [ charToClient: Transformation, -- transforms from character to client coordinates typeface: Typeface -- the data and class for the untransformed font ]; Typeface: TYPE ~ REF TypefaceRep; TypefaceRep: TYPE; -- see ImagerTypeface Substitution: TYPE ~ {noSubstitute, substituteWithWarning, substituteQuietly}; Find: PROC [name: ROPE, substitution: Substitution ¬ substituteWithWarning] RETURNS [Font]; Modify: PROC [font: Font, m: Transformation] RETURNS [Font]; Scale: PROC [font: Font, s: REAL] RETURNS [Font]; FindScaled: PROC [name: ROPE, s: REAL] RETURNS [Font]; SelectAlternateMetrics: PROC [font: Font, alternateMetrics: ROPE] RETURNS [Font]; Extents: TYPE ~ ImagerBox.Extents; -- RECORD [leftExtent, rightExtent, descent, ascent: REAL] CorrectionType: TYPE ~ MACHINE DEPENDENT {mask(0), space(1), none(2), (3)}; Contains: PROC [font: Font, char: XChar] RETURNS [BOOL]; NextChar: PROC [font: Font, char: XChar] RETURNS [next: XChar]; Escapement: PROC [font: Font, char: XChar] RETURNS [VEC]; Amplified: PROC [font: Font, char: XChar] RETURNS [BOOL]; Correction: PROC [font: Font, char: XChar] RETURNS [CorrectionType]; BoundingBox: PROC [font: Font, char: XChar] RETURNS [Extents]; FontBoundingBox: PROC [font: Font] RETURNS [Extents]; Name: PROC [font: Font] RETURNS [ROPE]; Kern: PROC [font: Font, char, successor: XChar] RETURNS [VEC]; NextKern: PROC [font: Font, char, successor: XChar] RETURNS [XChar]; Ligature: PROC [font: Font, char, successor: XChar] RETURNS [XChar]; NextLigature: PROC [font: Font, char, successor: XChar] RETURNS [XChar]; StringEscapement: PROC [font: Font, string: XStringProc, amplifySpace: REAL ¬ 1.0] RETURNS [VEC]; RopeEscapement: PROC [font: Font, rope: ROPE, start: INT ¬ 0, len: INT ¬ INT.LAST, amplifySpace: REAL ¬ 1.0] RETURNS [VEC]; TextEscapement: PROC [font: Font, text: REF READONLY TEXT, start: NAT ¬ 0, len: NAT ¬ NAT.LAST, amplifySpace: REAL ¬ 1.0] RETURNS [VEC]; StringBoundingBox: PROC [font: Font, string: XStringProc, amplifySpace: REAL ¬ 1.0] RETURNS [Extents]; RopeBoundingBox: PROC [font: Font, rope: ROPE, start: INT ¬ 0, len: INT ¬ INT.LAST, amplifySpace: REAL ¬ 1.0] RETURNS [Extents]; TextBoundingBox: PROC [font: Font, text: REF READONLY TEXT, start: NAT ¬ 0, len: NAT ¬ NAT.LAST, amplifySpace: REAL ¬ 1.0] RETURNS [Extents]; END.  ImagerFont.mesa Copyright Σ 1985, 1986, 1991 by Xerox Corporation. All rights reserved. Michael Plass, October 18, 1991 3:38 pm PDT Doug Wyatt, April 15, 1985 1:55:09 pm PST Xerox characters and strings An XChar is a 32-bit character code. The Imager itself does not really depend on the interpretation of the codes; but see the Xerox Character Code Standard for the currently preferred interpretation. These assume the Xerox string encoding; they treat '\377 as an escape code. See the Xerox Character Code Standard, section 6, and the Interpress Standard, section 2.5.3. Fonts The Font consists of a transformation along with a reference to the untransformed font object (i.e., Typeface). Fonts are canonicalized, so clients must treat them as immutable. Find the font with the given hierarchical name. It's safe to use RefText.TrustTextAsRope for the name. May raise Imager.Error or Imager.Warning. Modify a font by post-concatenating the given transformation. Equivalent to Modify[font, ImagerTransformation.Scale[s]]. Equivalent to Scale[Find[name], s]. Makes a new font with an alternate set of metrics. May raise Imager.Error. Metrics Returns TRUE iff the character exists in the font. Returns next char in the font, or nullXChar. Call with nullXChar to get first char in font. Returns escapement vector for the character. Returns TRUE iff the character is an 'amplifying' character. Returns the type of correction, if any, for the character. Returns a true bounding box for the character mask (not necessarily as tight as possible). Returns a bounding box for all character bounding boxes superimposed. Universal name of the font (see Interpress section 4.9.1); a font does not necessarily have a name Returns kerning adjustment between char and successor, or [0, 0]. Returns next successor that kerns with char. Call with successor=nullXChar to get first one. Returns a ligature formed from char and successor, or nullXChar. Returns next successor that has a ligature with char, Call with successor=nullXChar to get first one. ΚŠ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ=™HK™+K™)K™—šΟk ˜ Kšœžœžœ˜Kšœ žœ ˜Kšœžœ˜,Kšœžœžœ˜Kšœžœžœ˜—K˜KšΠbl œžœž ˜šœž˜K˜Kšžœžœžœ˜Kšžœžœ žœ˜Kšœžœ'˜;—head™Kšœžœžœ˜šœžœžœ˜#KšœΘ™ΘK™—šœ žœžœ˜%K˜—šœ žœžœ˜1K˜—K˜KšΟnœžœžœ žœ žœžœžœ˜Wš œžœžœžœžœ žœ žœžœžœ˜dKšœK™KK™]K˜——™šœ²™²K™—Kšœžœžœ ˜šœ žœžœ˜KšœΟc2˜PKšœ‘0˜CK˜K˜—Kšœ ž œ ˜!Kšœ žœ‘˜(K˜šœžœ<˜NK˜—š œžœžœ6žœ˜[Kšœ/™/K™6K™)K™—š œžœ!žœ˜KšœZ™ZK˜—š œžœžœ ˜5KšœE™EK˜—š œžœžœžœ˜'Kšœb™bK˜—K˜š œžœ&žœžœ˜>K™AK˜—š œžœ&žœ ˜DKšœ,™,Kšœ/™/K˜—š œžœ&žœ ˜DKšœ@™@K˜—š  œžœ&žœ ˜HKšœ5™5Kšœ/™/K˜—K˜š  œžœ1žœžœžœ˜aK˜—š œžœžœ žœ žœžœžœžœžœžœ˜{K˜—š œžœžœžœžœ žœ žœžœžœžœžœžœ˜ˆK˜—K˜š œžœ1žœžœ ˜fK˜—š œžœžœ žœ žœžœžœžœžœ ˜€K˜—š œžœžœžœžœ žœ žœžœžœžœžœ ˜K˜——Kšžœ˜—…— ΎN