<> <> <> DIRECTORY ImagerFont, ImagerTransformation, IO, Rope; GGFont: CEDAR DEFINITIONS = BEGIN <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>> FontData: TYPE = REF FontDataRec; FontDataRec: TYPE = RECORD [ literal: Rope.ROPE, -- "xerox/xc1-2-2/Modern-bold-italic" prefix: Rope.ROPE,-- "xerox/xc1-2-2/" literalFSF: Rope.ROPE, -- literal familySizeFace: "Modern-bold-italic" userFSF: Rope.ROPE, -- user familySizeFace: "Modern-BI" family: Rope.ROPE, -- family: "Modern" transform: ImagerTransformation.Transformation, scale: REAL _ 1.0, storedSize: REAL _ 1.0, designSize: REAL _ 1.0, comfortable: BOOL _ FALSE, bold, italic, faceKnown: BOOL _ FALSE, substituteOK: BOOL _ FALSE, substituted: BOOL _ FALSE ]; <> <<1. Literal User Format: a string provided by a wizard which contains what the FontData needs in literal form. This includes a full path name, a transformation, a storedSize, and a designSize. Literal user format produces a FontData with comfortable set to FALSE. This format is designed to take any arbitrary font and transformation that a user can invent.>> <<2. Detailed User Format: a string provided by a user with a prefix, userFSF, and transformation. Gargoyle derives the designSize and storedSize from the prefix and userFSF. Detailed user format produces a FontData with comfortable set to TRUE. This format is designed to deal with detailed but relatively normal font data.>> <<3. Short User Format: a string provided by the user with ONLY a userFSF and a scale factor. This is for use by vanilla users who want to continue to think about fonts in the old simple way. The prefix for this format is indirectly provided by the user to Gargoyle depending on what operation a user invokes when providing a short form. Short user format produces a FontData with comfortable set to TRUE.>> <<4. GGFile Format: this format is what is written/read in GG files. There are two versions of it, depending on whether the FontData is comfortable or not (see File Format, below). That fact is recorded in a BOOLEAN (comfortable: BOOLEAN) at the beginning of the file format entry; the BOOLEAN is followed by a literal format string if the BOOLEAN is F and prefix/userFSF if the BOOLEAN is T. The TextFilein code will treat the data as either Literal User Format (comfortable=FALSE) or Detailed User Format (comfortable=TRUE).>> <<5. Interpress file format: reading an interpress file and deriving one of our internal formats is tricky. We intend to manufacture a Literal User Format or Detailed User Format from the context state variables, depending on whether or not we recognize the font as being comfortable. If not, designSize=1.0 and storedSize=1.0 because we can't tell anything about the fonts that come in from Interpress masters.>> <> <> <<>> <> <<>> <> <> <> <> <> <<>> <> <<>> <> <> <> <> < pair such as "Helvetica-BI 12". The <-FontFace> may be left off, denoting regular font. Gargoyle assumes FontPrefix = Xerox/PressFonts/ and lets transformation M = Scale[]. The font is made with ImagerFont.Scale[font, 1] (in all cases I know about).>> < pair such as "Modern-BI 12". The <-FontFace> may be left off, denoting regular font. Gargoyle assumes FontPrefix = Xerox/XC1-2-2/ and lets transformation M = Scale[]. The font is made with ImagerFont.Scale[font, 1] (in all cases I know about).>> < pair such as "Tioga10 20" or "CMR 12". Gargoyle derives a storedSize from the . Gargoyle assumes FontPrefix = Xerox/TiogaFonts/ and lets transformation M = Scale[]. The font is made with ImagerFont.Scale[font, 1] if the font is CMR, with ImagerFont.Scale[font, 1.0/], if the font is Helvetica, TimesRoman, Tioga. If the font is one of the traditional TiogaFonts (e.g. Helvetica, TimesRoman, Tioga, ...) the font machinery will attempt to find the corresponding strike font. For example, SetScreenFont TimesRoman-BI 9 will find the font in file ///fonts/xerox/tiogafonts/TimesRoman9BI.ks. If the user requests a TiogaFont not in the Tioga font set (often an unusual size requested), Gargoyle will fail to change the font. At any rate, Gargoyle will have to keep track of which fonts are in which camp.>> < triple. Gargoyle assumes the designSize and the storedSize can be derived from the and ; if not, then designSize and storedSize are defaulted to 1.0. The user must provide a factored transformation. For example:>> <> <> <> < quintuple. Gargoyle accepts this as literal information and makes no attempt at understanding the semantics of the data. For example:>> <> <> <> <*(1.0/) isn't quite 1.0. We can either round within epsilon for screen fonts, or we can keep around an unscaled font when we know we should be hitting the fast case.>> <> < . There are two formats in which the user can request font information: Show and ShowLiteral. Show produces output which is suitable in format as input to SetFontDetailed; ShowLiteral produces output which is suitable in format as input to SetFontLiteral. For example:>> <> <> <> <> <<>> ParseError: ERROR [explanation: Rope.ROPE]; DefaultDefaultFontData: PROC RETURNS [data: FontData]; CreateFontData: PROC RETURNS [data: FontData]; InitFontData: PROC [data: FontData] RETURNS [newData: FontData]; CopyFontData: PROC [data: FontData, oldCopy: FontData _ NIL] RETURNS [newCopy: FontData]; <> ParseFontData: PROC [data: FontData _ NIL, inStream: IO.STREAM, literalP, prefixP, familyP, faceP, transformP, scaleP, storedSizeP, designSizeP: BOOL _ FALSE] RETURNS [newData: FontData]; <> <> LiteralDataFromFontData: PROC [data: FontData]; <> <> UserDataFromFontData: PROC [data: FontData]; <> <> AlternateFont: PROC [data: FontData, font: ImagerFont.Font, op: ATOM] RETURNS [alternate: ImagerFont.Font]; <> OldParseFontData: PROC [inStream: IO.STREAM, prefixP, familyP, faceP, transformP, sizeP: BOOL _ FALSE] RETURNS [fail: BOOL, prefix, family, face: Rope.ROPE, transform: ImagerTransformation.Transformation, size: REAL _ 0.0]; <> END.