fileName:
ARRAY [0..numberOfFileNames)
OF Rope.
ROPE = [
"/indigo/pressfonts/TimesRoman-mrr.sd",
"/indigo/pressfonts/TimesRoman-mir.sd",
"/indigo/pressfonts/TimesRoman-bir.sd",
"/indigo/pressfonts/TimesRoman-brr.sd",
"/indigo/tioga/tfm/TCLogo.TFM",
"/indigo/tioga/tfm/TEMPLATE.TFM",
"/indigo/tioga/tfm/TESTFONT12.TFM",
"/indigo/tioga/tfm/TimesRoman.TFM",
"/indigo/tioga/tfm/TimesRoman12.TFM",
"/indigo/tioga/tfm/TimesRoman12I.TFM",
"/indigo/tioga/tfm/TimesRoman14.TFM",
"/indigo/tioga/tfm/TimesRoman18.TFM",
"/indigo/tioga/tfm/TimesRomanB.TFM",
"/indigo/tioga/tfm/TimesRomanBI.TFM",
"/indigo/tioga/tfm/TimesRomanI.TFM"
];
Test1:
PROCEDURE [n:
INT] = {
file: ARRAY [0..numberOfOpenFiles) OF UFFileManager.FontFile;
FOR i:
INT
IN [0..n)
DO
slot: [0..numberOfOpenFiles) ← Random.Choose[0, numberOfOpenFiles-1];
fileNo: [0..numberOfFileNames) ← Random.Choose[0, numberOfFileNames-1];
UserExec.GetExecHandle[].GetStreams[].out.PutF["Slot %g request for %g\n", IO.int[slot], IO.rope[fileName[fileNo]]];
file[slot] ← UFFileManager.Open[UFFileManager.KeyOf[fileName[fileNo]]];
ENDLOOP;
FOR i:
INT
IN [0..numberOfOpenFiles)
DO
file[i] ← NIL;
ENDLOOP;
};
fontFileWatcher: UFFileManager.FontFileWatcher = {
actionMsg: Rope.
ROPE ←
SELECT action
FROM
open => "Opened",
close => "Closed",
openFailed => "Failed to open",
ENDCASE => ERROR;
UserExec.GetExecHandle[].GetStreams[].out.PutF["%g file %g\n", IO.rope[actionMsg], IO.rope[UFFileManager.NameOf[key]]];
};