FontSwap - Toggle desktop font

by Graham Crow


FontSwap is for the Risc PC (RISC OS 3.5) or later, and can be run from the RISC User master menu system by clicking on its icon.

The Risc PC allows the use of outline fonts on the desktop, in place of the system font used on previous machines.  The font is set by running '...$.!Boot.Resources.!Configure', clicking on 'Fonts', popping up the fonts menu, choosing a font, and finally clicking on 'Set'.  For the programmer, this is a particularly irksome process, since it is frequently necessary to change fonts to make sure that window layouts look good when displayed in different fonts.

FontSwap was written to simplify this process.  It allows the user to make temporary changes to the desktop font by swapping between any two selected fonts with a single mouse click.  For good measure, you can also change the width/height of the font, a feature not available in !Configure.  For non-programmers, FontSwap provides a convenient way of experimenting with different desktop fonts.

Set font
To set the desktop font click on one of the font buttons with Select or Adjust.  Note that increasing the size of the Font Cache in the Task Manager can improve the redraw speed.  (To increase the size of the FontCache so that it survives a hard reset use *Configure FontSize nK).

Change font
Click on one of the right arrows to open a dialogue box.  Then click on the pop-up menu icon to display the font list from which you can choose a new font.  To change the Height or Width click on the arrows or enter a specific value (within the points range 8.0 to 16.0).  Click OK to accept the new font data or Cancel to revert to the previous values.

Save choices
Click Menu on the icon bar icon and choose 'Save choices'.  The font names and sizes are saved as a text file 'Choices' in the application directory, and will become the defaults next time the program is run.

Quitting FontSwap
When you quit FontSwap from the icon bar menu the desktop font is restored to the configuration which applied before FontSwap was launched.  To make a 'permanent' change to the desktop font you will need to use !Configure.

Technical Note
The desktop font is changed by using *Configure WimpFont n where n is a number between 0 and 15 specifying the font to use.  If n is zero then the Wimp$Font variables are used to specify the font name, width and height.  This is followed by calling Wimp_SendMessage to request that the Wimp broadcast the message Message_FontChanged.  The Wimp checks the relevant CMOS bits (byte 140, bits 1-4) and the system variables used by *Configure WimpFont.  If it detects a change it loses the current font and attempts to find the new font with the font manager.  If successful, then it selects that font; otherwise it reverts to the system font.  The Wimp then broadcasts Message_FontChanged to all tasks.


Copyright  RISC User 1995
