SpecialFX module by David Pilling
SpecialFX Setup utility and documentation by Richard Hallas
The software remains the copyright of its authors but may be distributed freely
The following article is derived from a pair of articles that first appeared in Foundation RISC User magazine.
The third of those functions is of least interest to most users, as it is relevant mainly to owners of Calligraph direct-drive laser printers. I will not dwell on it in this article, therefore; if you own a Calligraph printer, or are just interested in what the fix actually does, you may like to read the SpecialFX application's Help file for more details about it. The only point worth mentioning here is that the fix is completely safe; it should have no adverse effects on any printed output, whether or not a Calligraph printer is in use. It also defaults to being turned off.
The two main functions affect only things that are drawn on the screen; they have no effect on printed output.
The anti-aliasing function requires two third party software modules to be loaded: Computer Concepts' GDraw and DitherExtend modules. A third module, GSpriteExtend, is beneficial but not essential. In order to be able to find these modules, certain software from Computer Concepts & MW Software must be installed on your system, and in a place where SpecialFX can locate the modules when it is first launched. Although SpecialFX is able to look for the modules in various places, the recommended method of storing these modules, and ensuring that they're kept up to date, is to have a copy of the ArtWorks Viewer application in the !Boot.Resources directory, where it will be seen during the computer's boot-up process. Users of RISC OS Select and RISC OS 5 should find that a copy of the application is already present there. Anyone who does not have a copy present there should install one; the latest version can be found at MW Software's site.
The second function, font blending, requires that a version of RISC OS from 3.7 onwards is in use, as the background-blending font manager was introduced in that version of RISC OS.
The third function, the printing fix, concerns the use of 'dynamic areas', which were introduced with RISC OS 3.5; the printing bug does not affect users of earlier systems.
The substantial difference between Computer Concepts' version of the Draw module, which they called GDraw, and Acorn's original is that the Computer Concepts version performs anti-aliasing, shading the edges of lines so that they appear to be smooth. This clearly gave ArtWorks (and Impression, which used the same module) a quality advantage over other applications when displaying vector graphics on the screen.
Clearly it would be nice if some clever software could cause all the applications that normally use the Draw module to draw graphics on the screen to use the GDraw module instead, and thus benefit from the latter software's anti-aliasing facilities. That's what SpecialFX does. Figure 1 consists of two screenshots of the same Draw file (a screen grab of a normal Draw window), showing exactly the same graphic in each. (For the curious, it's a rendition of the emblem of the Wakefield diocese, which I created in Draw for use in a brochure many years ago.) Image (a) on the left shows the graphic as Draw normally displays it, without anti-aliasing. Image (b) on the right is exactly the same graphic with SpecialFX turned on. The improvement in quality that anti-aliasing can produce should be obvious.
Figure 1(a): Without anti-aliasing |
Figure 1(b): With anti-aliasing |
Figure 2: The difference between a thin line (above) and one with a 0.5pt width (below); both shapes are otherwise identical |
The solution is very simple for such shapes: just set their line colour to 'None'. Figure 3 shows two almost identical shapes. In both cases the line width is set to 'Thin', but in the upper shape the line colour is black, whereas in the lower shape the line colour has been set to 'None', allowing the anti-aliasing to work.
Figure 3: Two virtually identical filled shapes with line width 'Thin'; in the upper shape the surrounding line colour is the same as the fill, whereas in the lower shape the line colour has been set to 'None' |
When Acorn released RISC OS 3.7, it incorporated the so-called background blending font manager: the new facility was an ability to anti-alias text to a changing background, so any given shaded pixel in the plotted character would be shaded between the font colour and the colour of that particular pixel on screen, rather than the font colour and the font's background colour.
This is best demonstrated by an illustration. Figure 4 shows what text looks like on a very colourful background if regular anti-aliasing is used. Note how the uniform background colour defined for the text (in this instance, white) is totally inappropriate for the very vibrant background on which it actually appears. It causes the edges of all the letters to be given a grey/white halo which makes them hard to read.
Figure 4: Anti-aliasing can create a halo around text on a variegated background |
Figure 5 shows similar text on an identical background to figure 4. However, in this case, SpecialFX has been used to turn background blending on (the picture is a screenshot of another Draw file). As should be clear, the text is now far more attractive and legible because the anti-aliasing colour for every single shaded pixel in the text is now a shade of the pixel's underlying background colour, rather than a shade between the foreground and background colours of the text itself.
Figure 5: Background blending shades the character edges between the foreground colour and the background pixels |
Background blending requires more computing power to process than normal anti-aliasing, and hence blended text is a little slower to plot than standard text. However, most users (especially of StrongARM computers) should not notice any discernible performance degradation on their systems even if background blending is used all the time, as SpecialFX allows it to be.
A few applications (for example, Ovation Pro and Fresco) support the background blending feature of the font manager themselves. Most applications, though, do not, and so SpecialFX allows you to enforce its use in whatever applications you like.
One application that suffers from this effect, albeit in a minor way, is Draw itself. If you enter new outline font text in a Draw window when background blending is being enforced, then the whole string will be replotted each time you type in a new character. This causes a blotchy build-up of text as you type in the string. Figure 6 illustrates the problem. Luckily this is only a short-term irritation; once the text has been entered, then it will be plotted correctly in future (just wipe a window or menu over it to replot it and get rid of the blotchiness). The enhanced quality of background-blended text in a Draw window (especially if you're using text to label a colourful illustration etc.) more than makes up for the minor cosmetic glitch when entering the text in the first place.
Figure 6: Draw suffers from a minor glitch when entering text, but it's only a temporary nuisance |
This is only a problem if, for example, you want the text background colour to be visible. Although it's far from advisable, some people occasionally set the text background colour to be quite different to the colour of underlying objects in a Draw window, so that the 'halo' effect is obvious on the screen, and allows the text to stand out more against its background. This is really not a good idea (as it looks ugly and won't appear on a printout anyway), but it's sometimes seen. If background blending is used, the 'halo' will vanish completely, and the text may become very difficult to read. Figure 7 gives an example. Most people will not find this to be a problem, but it's worth being aware of the situation.
Figure 7: Although it's a bad idea to do this, the text's anti-aliasing background colour can be used to differentiate it from the background on which it actually appears (above); however, use of background blending will eradicate this effect (below) | ||
It's easy enough to duplicate the 'halo' effect in a better way in any case (in Draw at least). Just convert your text to paths and then give the resultant shapes different line and fill colours, preferably using lines that are not 'Thin'. This produces a much nicer, more substantial outline for the text, as can be seen in figure 8.
Figure 8: A better version of the 'halo' effect can be produced by converting text to paths and then applying separate line and fill colours |
The latest version 1.05 of SpecialFX provided here comprises two main components:
First, on all systems:
Next,
The next step depends on the version of RISC OS you're using:
RISC OS 5 systems:
RISC OS Select (version 4.2+) systems:
RISC OS 4.0x systems:
RISC OS 3.5/6/7 systems:
Optional step: altering the Configure icon
The versions of Configure supplied with RISC OS 4.0x, RISC OS Select and RISC OS 5 all have different sprite styles for the plug-ins. RISC OS 4.0 uses jigsaw-puzzle icons; RISC OS Select uses more refined-looking jigsaw-puzzle icons (with elongated lugs); RISC OS 5 uses icons without jigsaw puzzle borders. Unfortunately, there is no way to make a Configure plug-in adapt its Configure icon for the version of Configure currently in use. As supplied, SFXSetup has RISC OS 5-style icons preinstalled. So, to make SFXSetup match the appearance of your other plug-ins, as an extra step you can install appropriate icons for your version of RISC OS. Look in the Extras directory; it contains RISC OS 4, RISC OS 4S (i.e. RISC OS Select: 4.2 or later versions) and RISC OS 5 folders. Open the folder relating to the OS installed on your machine and drag the copy of SFXSetup that you find there over the copy that you have already installed on your own hard disc. This will update the sprites inside it to match your system. |
|
Finally, on all systems:
Note: users of RISC OS 4 and RISC OS 5 systems may also use SpecialFX Setup as a normal application by double-clicking it to launch it; it doesn't have to be installed into Configure.
The behaviour of the application is straightforward, and detailed interactive help is provided, but there are a few subtleties which are worth mentioning here. The three columns of switches in the scrolling pane correspond to the three basic features provided by SpecialFX, governing, from left to right, the Vector anti-aliasing (G
flag), Background blending (B
flag) and Printing fix (L
flag) settings. (Use of the flags with the *SpecialFX
command is described in the last section of this article.)
The first entry in the scrolling window, (Default settings), will always be present and governs the normal behaviour of the SpecialFX module. This behaviour is applied to all applications unless overridden by one of the specific named application settings, listed below the dividing line in the scrolling window. Various preset entries are provided, but you can edit and delete them and add new overrides of your own.
To add a new entry to the scrolling window, click the Add icon to pop up a menu. From this you can either choose the name of a running application or type in a task name yourself. New entries will inherit the current default settings you've chosen in the window; the only exception to this is if you delete and then reinstate an application entry: when restored, it will remember the settings it had previously.
The entries in the scrolling pane can be selected by clicking on the application names, and you can highlight several at once by clicking with Adjust. (The Select all and Select none buttons may also be used to alter highlighting quickly.) The Delete button becomes available if at least one entry is highlighted (excluding the default settings, which can't be deleted!).
The Set button has some slightly non-obvious behaviour which is worth explaining here: its action depends on whether or not any entries are highlighted in the scrolling pane. Whilst clicking Set will always cause settings to be enforced immediately, the subtlety is as follows:
This behaviour is intended to make it easy to experiment quickly with the behaviour of individual applications. However, the Save button will always enforce and save all entries in the window, regardless of whether or not they're highlighted.
The Reset button also has a dual function. Clicking it with Select will reset all current settings in the window to their saved states on disc. Clicking with Adjust will reload the 'factory default' settings (i.e. the basic recommended set of overrides).
However, there is a further subtle but important consideration when resetting the contents of the SpecialFX Setup window. When the application is first launched, it performs two actions:
Use of the Reset button involves only the choices files saved on disc; memory overrides will not be taken into account when this button is used. If you want to include them (in other words, to make SpecialFX Setup behave in exactly the same way as it would when first starting up), choose the Refresh option from SpecialFX Setup's main menu.
The main menu has another couple of useful options. The Show status menu contains two further options, Current task settings and Wimp filters installed, which issue *SpecialFXTasks
and *SpecialFXFilters
commands, respectively, and display their output in task windows. Finally, the Help option loads SpecialFX's help file into the default text editor.
The last item to mention is the Always load SpecialFX switch. This switch is not considered part of the SpecialFX settings; it takes action instantly, and installs or removes a small Obey file in the current user's Boot.Tasks directory to determine whether or not the SpecialFX module is loaded during start-up. It is recommended that the option should normally be left turned on.
In other words, you use SpecialFX at your own risk. In reality it doesn't do anything remotely dangerous which could 'harm' your system, and is entirely safe; using it won't cause your hard disc to wipe itself or your monitor to blow up. Nevertheless, by its very nature, it makes applications do things that they weren't designed to do, and in a small number of cases that can cause problems.
Such problems should all be minor in nature, like the blotchy text-entry in Draw. Another example of background blending going wrong is with WordWorks from Computer Concepts; enforcing background blending with this application can sometimes cause the text in its window to be printed in a funny colour, or vanish completely (because it's appearing in white on a white background).
That's about the worst problem that can occur with background blending. The vector anti-aliasing feature can also cause other minor problems. It may also very occasionally cause text to vanish, or in a handful of programs it could cause dragging operations to leave a trail of pixels on the screen. These are only minor irritations, but they're clearly not desirable.
Therefore, SpecialFX has been written in such a way that its features can be turned on and off individually and automatically for particular applications. As distributed here, SpecialFX has already been set up with a number of configuration choices to disable its features for applications that are known to have problems with them (such as the WordWorks example given above), and for applications where they're known to be unnecessary (for example, Ovation Pro already performs its own blending).
So, in order to be able to make best use of SpecialFX, you need to be aware that problems can occur with it in a small number of cases, and what those problems are likely to be. If text appears blotchy or in a funny colour, suspect SpecialFX's background blending feature. If you see nothing where you would expect to see a vector object, or see trails of pixels during a drag, suspect SpecialFX's GDraw anti-aliasing. It should be stressed that such problems are rare, and all the known cases have already been catered for in the copy of SpecialFX distributed here. But if you should come across other examples, they can be overcome by turning the offending SpecialFX feature off for the application in question.
SpecialFX
. Issuing this command, followed by a selection of letters, will alter the current default settings used by the software.
Normally, SpecialFX defaults to having vector anti-aliasing and background blending turned on for all applications. The command to set this default is:
*SpecialFX BG
B
means 'turn on B
lending' and G
means 'turn on G
Draw anti-aliasing'. To turn off either of these commands, a tilde character (~
) should precede the appropriate flag-letter. So this command:
*SpecialFX ~B~G
A third option, L
(and ~L
) is available to turn the L
ow-memory printing fix on and off.
To summarise the options, the following three flags are available to the *SpecialFX
command:
B
: use background blending flag (only on the screen)G
: use the GDraw module for anti-aliasing (only on the screen)L
: use the low-memory printing fix (only when printing)~
turns the feature off.
You can specify any or all of the three flags in a single *SpecialFX
command.
Now, issuing the above command will alter the default behaviour of SpecialFX with all applications, but because of problems that may occur with individual programs, as described above, it's necessary to be able to override the default behaviour for particular applications. In order to do this, it's possible to add a 'task name' to the end of a *SpecialFX
command to make the command apply to that task only. So, for example:
*SpecialFX ~B "Draw"
G
and L
flags have not been specified in the above command, their current settings in relation to Draw would not be affected.
Because SpecialFX defaults to having both vector anti-aliasing and background blending enabled in all applications, it's necessary to disable them in 'problem' applications in this way. However, it would be perfectly feasible to take the reverse approach and disable these features by default for all applications (i.e. the normal operation of RISC OS would not be affected at all). Then, the options could be turned on for individual applications which are known to benefit from them.
How do you know what name to use to apply settings to a particular application? The answer is that you must look the name up in the Task Manager's Tasks display window, obtained by clicking on the logo icon at the far right of the icon bar (be it an Acorn, a RISC OS 4 cube, a RISC OS cogwheel, a blue jellybean or something else!). In some cases the name is obvious (Draw is just "Draw", for example), but other applications have more complex names. Vantage, for example, is "Cerilica Vantage". In cases like this, where the name consists of two or more words separated by spaces, it's particularly important that quotation marks are used to surround the name in the *SpecialFX
command. (For single-word names, the quotes are optional.)
*SpecialFX
commands can be entered directly at any time, either from the command line (press <F12> to get to it, and <Return> alone to return to the desktop from it) or from a task window (press <Ctrl-F12> to open one). Commands can, of course, be included in Obey files, and the Choices file saved by SpecialFX Setup is in fact just an Obey file containing a set of *SpecialFX
commands which may be edited by the user.
SpecialFXTasks
SpecialFXFilters
*SpecialFXTasks
command. In other words, *SpecialFXFilters
will list the applications which (a) appear in the list of overrides and (b) are running at present. Programs will only appear here if their SpecialFX settings are different from the general SpecialFX defaults; just because applications are not listed does not mean that they are not benefitting from SpecialFX's features.
SpecialFXRemove
SpecialFX
command. So, for example, if you have overridden the default SpecialFX behaviour in Draw by issuing a command such as:
*SpecialFX ~B "Draw"
*SpecialFXRemove "Draw"
And that's all there is to it! Further information is provided in the SpecialFX application's Help file, which may also be viewed by choosing the Help option of SpecialFX Setup's main menu.