DIRECTORY IO, MessageWindow, PressReader, Real, Rope, UserExec; ListFontsInPressFileCommand: PROGRAM IMPORTS IO, MessageWindow, PressReader, Real, UserExec = BEGIN ROPE: TYPE = Rope.ROPE; ListFonts: UserExec.CommandProc = TRUSTED { fileName: ROPE _ IO.GetToken[event.commandLineStream, IO.WhiteSpace]; pressFile: PressReader.Handle _ PressReader.OpenPressFile[fileName ! PressReader.PressReaderError => { MessageWindow.Append[ message: SELECT errorCode FROM FileNotAPressFile => "File not a Press file!", FileNotAvailableForRead => "File not readable!", ENDCASE => ERROR, clearFirst: TRUE]; MessageWindow.Blink[]; GOTO Quit; } ]; log: IO.STREAM _ UserExec.GetStreams[exec].out; FontPrinter: PressReader.FontEntryProc = { texDesignSize: REAL _ -1.0; log.PutRope["\nFamily 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", IO.int[fontDirectoryEntry.rotation]]; }; -- FontPrinter pressFile.GetFonts[FontPrinter]; pressFile.ClosePressFile[]; EXITS Quit => NULL; }; UserExec.RegisterCommand[ name: "ListFontsInPressFile", proc: ListFonts, briefDoc: "Lists the fonts used in the named press file"]; END. VListFontsInPressFileCommand.mesa Last edited by Plass on April 18, 1983 5:49 pm Κ§˜Jšœ ™ J™.šΟk ˜ Jšœ3˜5—šœ˜$Jšœœ,˜6Jšœ˜Jšœœœ˜šœ"œ˜+Jšœ œœ#œ ˜EšœD˜Dšœ!˜!šœ˜šœ œ ˜Jšœ.˜.Jšœ0˜0Jšœœ˜—Jšœ œ˜—Jšœ˜Jšœ˜ Jšœ˜—Jšœ˜—Jšœœœ!˜/unitšΟn œ˜*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šœœ#˜AJšœΟc˜—Jšœ ˜ Jšœ˜Jšœ œ˜Jšœ˜—šœ˜Jšœ˜Jšœ˜Jšœ:˜:—Jšœ˜——…—n k