home *** CD-ROM | disk | FTP | other *** search
- Using Windows PS files with RiScript
- ------------------------------------
-
- Windows PS files rarely work first time with RiScript. Often, you will
- find you just get the RiSc> prompt back almost immediately and a blank
- document displayed. Other times, there will be postscript errors which
- look very impenetrable and rather useless.
-
- The first thing to check is that new lines are in the RISC OS form (ie.
- just line feeds, no carriage returns). If this is not the case, RiScript
- will try to interpret the ^M characters which are on the end of each
- line. With Zap, you can easily convert the PS file by loading it in,
- deselecting the DOS text mode option from the menu and saving again.
- Other editors will have different ways of doing this.
-
- The second problem is that Windows includes its own error handler by
- default, which tries to print the error on the page, rather than leave
- the interpreter to report it. This causes a slight problem if another
- error occurs while it is trying to display the error! This problem is
- easily fixed by searching for a line:
-
- ErrHandler
-
- which usually appears shortly after %%BeginSetup, and removing it. This
- will ensure that any errors which occur will get reported correctly.
-
- Having done this, the most likely error to get is
- %%[Error: undefined; OffendingCommand: --get--]%%
- followed by a stack dump ending with /CharStrings
-
- The problem here is that the Window PS driver is trying to determine
- whether a particular character is present in a font. This fails with
- RiScript as it uses special font definitions to work with the RISC OS
- font manager and the font dictionaries do not contain a CharStrings
- entry.
-
- The solution is to search for the text
- /IsChar{basefontdict /CharStrings get exch known}bd
- (which may be split over a line break) and replace it with
- /IsChar{pop true}bd
-
- This simply means that the postscript program will always think that the
- relevant character is known, without needing the CharStrings dictionary.
- There is no problem with reporting all characters as known since the
- RISC OS fonts do contain all the characters.
-
- Usually, the PostScript file will now be displayed with no further errors
- but you may find that any shading goes outside the bounds of the area
- which it is supposed to fill. This is caused by RiScript not supporting
- clip paths and is unavoidable. You may also get red boxes appearing if
- this happens. The red boxes are printed to indicate where the clip
- paths would be but aren't really very useful.
-
- Editing !RiScript.System.NYI and replacing the definition of /clip with
- /clip {} def
- will prevent these annoying red boxes being displayed but will not help
- the overflow of fills.
-
- --
- Chris Poole, c.e.poole@iee.org.uk, 8-3-96
-