-- PressUserCm.mesa
-- Edit: Johnsson; 17-Mar-81 10:48:04
-- Edit: Paul Rovner; 6-Jan-82 19:15:46
-- Edit: Warren Teitelman; 22-Mar-82 22:03:33
-- Edit: MBrown on April 29, 1982 3:34 pm
-- Edit: Plass on May 2, 1983 3:45 pm

DIRECTORY
LongStorage USING [CopyString, Free],
Press USING [PutFontInTable],
PressUtilities USING [],
Rope,
UserCredentials,
UserProfile;

PressUserCm: PROGRAM
IMPORTS
LongStorage,
Press,
Rope,
UserCredentials,
UserProfile
EXPORTS
PressUtilities
= BEGIN

SetupFontsForNonProgDisk: PUBLIC PROC [landscape: BOOLEAN ← FALSE] =
BEGIN
eight: CARDINAL ← 8;
ten: CARDINAL ← 10;
twelve: CARDINAL ← 12;
eighteen: CARDINAL ← 18;
twentyfour: CARDINAL ← 24;

IF landscape THEN { eight ← 6; ten ← 8; twelve ← 10; eighteen ← 14; twentyfour ← 18};
Press.PutFontInTable[0, "TimesRoman"L, ten];
Press.PutFontInTable[1, "TimesRoman"L, eight];
Press.PutFontInTable[2, "Logo"L, twentyfour]; -- X, E, R, and O only
Press.PutFontInTable[3, "Math"L, ten];
Press.PutFontInTable[4, "Hippo"L, ten];
Press.PutFontInTable[5, "TimesRoman"L, twelve];
Press.PutFontInTable[6, "Helvetica"L, ten];
Press.PutFontInTable[7, "Helvetica"L, eight];
Press.PutFontInTable[8, "Gacha"L, ten];
Press.PutFontInTable[9, "Helvetica"L, eighteen];
END;

hardcopyUserName: PUBLIC LONG STRING ← NIL;
hardcopyHost: PUBLIC LONG STRING ← NIL;
hardcopyFont: PUBLIC LONG STRING ← NIL;

SetupHardCopyOptions: PUBLIC PROC [] = {
SetString[@hardcopyHost, Rope.Flatten[
UserProfile.Token["Hardcopy.PressPrinter", "Clover"]]];
SetString[@hardcopyUserName, Rope.Flatten[
UserProfile.Token["Hardcopy.PrintedBy", UserCredentials.GetUserCredentials[].name]]];
SetString[@hardcopyFont, Rope.Flatten[
UserProfile.Token["Hardcopy.Font", ""]]];
-- Hardcopy.Font token in User.Profile should not contain an embedded blank ...
};

SetString: PROC [p: POINTER TO LONG STRING, s: Rope.Text] = {
-- Free old contents of p^, if any; then copy s to it
LongStorage.Free[p^];
p^ ← NIL;
IF s.Length[] = 0 THEN RETURN;
p^ ← LongStorage.CopyString[LOOPHOLE[s]] };

END.

8-Mar-82 11:26:37 W.Teitelman. Changed use of CVExecutive.UserName to UserExec.GetNameAndPassWord[].name

22-Mar-82 22:03:47 W.Teitelman. Changed spelling of GetNameAndPassWord to GetNameAndPassword

April 29, 1982 3:33 pm MBrown. Discard SetupFontsForBravo; use UserProfile instead of CmFile for PressPrinter, PrintedBy, Font.

November 1, 1982 10:51 am Michael Plass. Removed calls to UserProfile.Open and UserProfile.Close

May 2, 1983 3:43 pm Michael Plass. Changed use of UserExec.GetNameAndPassword to UserCredentials.GetUserCredentials