DIRECTORY IO, PressReader, Real, Rope, Commander; ListFontsInPressFile: PROGRAM IMPORTS IO, PressReader, Real, Commander = BEGIN ROPE: TYPE = Rope.ROPE; ListFonts: Commander.CommandProc = TRUSTED { fileName: ROPE _ IO.GetTokenRope[IO.RIS[cmd.commandLine], IO.IDProc].token; pressFile: PressReader.Handle _ PressReader.OpenPressFile[fileName ! PressReader.PressReaderError => { cmd.err.PutF["File \"%g\" %g\n", IO.rope[fileName], IO.rope[SELECT errorCode FROM FileNotAPressFile => "is not a press file!", FileNotAvailableForRead => "is not readable!", ENDCASE => ERROR]]; GOTO Quit; } ]; log: IO.STREAM ~ cmd.out; FontPrinter: PressReader.FontEntryProc = { texDesignSize: REAL _ -1.0; log.PutRope["Family name: "]; log.PutRope[fontDirectoryEntry.family]; IF fontDirectoryEntry.face.encoding < 18 THEN { log.PutF["\n Face: %g == Weight: %g, Slope: %g, Expansion: %g", IO.int[fontDirectoryEntry.face.encoding], IO.rope[SELECT fontDirectoryEntry.face.weight FROM medium => "medium", bold => "bold", light => "light", ENDCASE => ERROR], IO.rope[SELECT fontDirectoryEntry.face.slope FROM regular => "regular", italic => "italic", ENDCASE => ERROR], IO.rope[SELECT fontDirectoryEntry.face.expansion FROM regular => "regular", condensed => "condensed", expanded => "expanded", ENDCASE => ERROR]]; } ELSE { texDesignSize _ (254.0-fontDirectoryEntry.face.encoding)/2.0; log.PutF["\n Face: %g == TEX design size %g", IO.int[fontDirectoryEntry.face.encoding], IO.real[texDesignSize] ]; }; log.PutF["\n Size: %g", IO.int[fontDirectoryEntry.size]]; IF texDesignSize>0 AND fontDirectoryEntry.size<0.0 THEN { magnification: REAL _ -fontDirectoryEntry.size*72.27/(2540*texDesignSize); magnification _ Real.RoundLI[magnification*100]/100.0; log.PutF[" (magnification %g)", IO.real[magnification]]; }; log.PutF["\n Rotation: %g\n", IO.int[fontDirectoryEntry.rotation]]; }; -- FontPrinter pressFile.GetFonts[FontPrinter]; pressFile.ClosePressFile[]; EXITS Quit => NULL; }; Commander.Register[ key: "ListFontsInPressFile", proc: ListFonts, doc: "Lists the fonts used in the named press file"]; END. ˆListFontsInPressFile.mesa Last edited by Plass on April 18, 1983 5:49 pm Last Edited by: Beach, February 24, 1984 3:00:29 pm PST Κ¦˜šœ™J™.J™7J™—šΟk ˜ Jšœ%˜'—šœ˜Jšœœ˜(Jšœ˜—Jšœœœ˜šΟn œœ˜,Jš œ œœœœœ˜KšœD˜Dšœ!˜!šœ3˜3šœœ ˜Jšœ,˜,Jšœ.˜.Jšœœ˜——Jšœ˜ Jšœ˜—Jšœ˜—Jšœœœ ˜unitšž œ˜*Jšœœ˜Jšœ˜Jšœ'˜'šœ'œ˜/šœ?˜?Jšœ'˜)šœœ ˜2Jšœ˜Jšœ˜Jšœ˜Jšœœ˜—šœœ˜1Jšœ˜Jšœ˜Jšœœ˜—šœœ#˜5Jšœ˜Jšœ˜Jšœ˜Jšœœ˜—J˜—šœ˜Jšœ=˜=šœ-˜-Jšœ'˜)Jšœ˜J˜—Jšœ˜——Jšœœ˜9šœœœ˜9Jšœœ7˜JJšœ6˜6Jšœ œ˜8J˜—Jšœœ#˜CJšœΟc˜—Jšœ ˜ Jšœ˜Jšœ œ˜Jšœ˜—šœ˜Jšœ˜Jšœ˜Jšœ5˜5—Jšœ˜—…— N