We'd (Ray, Ralph and Henry) like to add an error message if the GenericResourceDir does not exist. This caused all sorts of problems for me, that naively thought if the system could find fonts in Resource/Fonts it should also find Resource/Decoding and other resources. If the resource directory does not exist it will find the fonts but no other resources like encoding or decoding. This results in a mysterious undefinedresource in the findfont operator.
Created attachment 4800 [details] patch Check that gs_init.ps can be found at $(GenericResourceDir)/Init/gs_init.ps Issue a warning if this file cannot be found. The execution is not terminated because the initial value of GenericResourceDir may be wrong but corrected later by setsystemparams operator. I cannot het the status of $(GenericResourceDir) because it doesn't exist on the fl;at file system such as %rom% . Concatenation of multiple strings can be done more efficiently than calling concatstrings repeatedly. I'm not sure whether it's worth the trouble. Here's a procedure that concatenates N strings. /concatNstrings { % (a) (b) ... (z) N --> (ab...z) dup 1 add copy 0 exch { exch length add } repeat dup string % (a) (b) ... (z) N len (____) 3 -1 roll % (a) (b) ... (z) len (____) N { dup % (a) (b) ... (z) len (____) (____) 4 2 roll % (a) (b) ... (____) (____) (z) len 1 index length sub % (a) (b) ... (____) (____) (z) len-zlen dup % (a) (b) ... (____) (____) (z) len-zlen len-zlen 5 1 roll % (a) (b) ... len-zlen (____) (____) (z) len-zlen exch putinterval % (a) (b) ... len-zlen (___z) } repeat exch pop } bind def
The approach in the patch is OK, but I think the message could be more helpful: (\n*** Warning: GenericResourceDir doesn't point to a valid resource directory. ***) = ( the -sGenericResourceDir=... option can be used to set this.\n) = I'll let Alex decide whether to accept this suggestion or not, but I think we might as well give a hint to users as to how to fix the problem. If the explicit message about -sGenericResourceDir= is not desired, then just referring the user to doc/Use.htm#Resource_related_parameters would be OK as well.
A modified patch that includes a hint about -sGenericResourceDir= has been committed as a rev. 9495. Regression testing shows no differences.