home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1996
/
ARCHIVE_96.iso
/
discs
/
mag_discs
/
volume_6
/
issue_06
/
riscos_3
/
!DeskFonts
/
ReadMe2
< prev
next >
Wrap
Text File
|
1993-01-22
|
9KB
|
224 lines
About DeskFonts
---------------
Deskfonts is a utility which replaces the default system font with an outline
font of your choice in the desktop and wherever else VDU5 type text is used.
Technical details about how Deskfonts works and some of the un-avoidable
problems involved are given at the end of this document. What follows is a
description of the DeskFonts multi-tasking frontend which is all that most
people will see.
Load !DeskFonts in the usual way, by double clicking on it's icon. The
program will install on the icon bar and clicking on this icon opens the
main window. From top down, the functions which are then available are as
follows:
Click on the option switch at the extreme top-left to toggle between the
normal system font and the anti-aliased font. When this switch is on, the
anti-aliased font will be used. Choose a anti-aliased font from the menu of
available fonts. This menu may be opened by clicking on the icon called
'Fonts...' or by clicking MENU anywhere within the window. When choosing a
font, it is important to note that proportional fonts (which make up the vast
majority of outline fonts available) can cause problems. See below for
details.
The 'Disable during errors' switch, when on, disables Deskfonts whenever an
Operating system error box is about to open and re-enables the program when
the box closes. This has the effect of making all the text that appears
within the error box show up in the system font but is safer, if the error
was generated within Deskfonts (eg a corrupted font) and this switch is off
then the text displayed within the error box could, itself cause an error
which would lead to an infinate loop...and the reset button!
The Size X and Size Y options allow you to change the size of the text in
(surprise surprise !) the horizontal and vertical directions. Some restraint
is necessary when altering the sizes. To change a size, either use the left
and right arrow icons (1/4 point change or 1 point with SHIFT held down),
or, enter a value into the writable size icon and press RETURN.
In Corpus, the maximum sizes that can reasonably be used are - XSize 10.75,
Ysize 16.5
The Offset X size should normally be zero. Small values (eg 1 or 2) can be
useful sometimes, but larger values almost always cause a mess. The value
is os-units extra before each string.
The Offset Y size should normally be about 22. You may have to alter this if
using a unusual text size, either increasing or decreasing it for larger and
smaller y text sizes.
The Settings box allows you to save, re-load and reset all of the above
settings. Saved settings are automatically re-loaded with the program so you
can 'tune' deskfonts to suit your preference and then save these settings.
The Reset box (made large deliberately) is used in a 'panic' situation. Eg.
you've chosen a font width of 0.001 points and you can't read anything! It
resets all of the values to defaults and also resets the display to the
system font.
The Icon bar menu
-----------------
Fairly standard except that 'Quit' has a sub-menu. Choosing 'Quit>Complete'
or just 'Quit' removes DeskFonts entirely and resets to the system font.
Choosing 'Quit>Partial' leaves the DeskFonts module active, displaying the
last settings you chose.
Technical notes
---------------
Problems
--------
Proportionally spaced fonts cause problems when used in place of the system
font. In particular -
Text which is normally centred (eg in an icon) almost never is. The caret
does not appear in the correct place within writable icons. Text which
contains a great number of wide characters (eg uppercase W in most fonts)
can overlap the edges of the icon it's supposed to be within.
There is a known problem with the window manager call which produces the
standard 'Wimp-Report' error box. Sometimes, for no apparent reason the text
is printed in vdu 4 mode at the top of the screen rather than in the error
window. To follow Acorn guidelines correctly, DeskFonts should remove itself
(ie restore the system font) before an error window opens and relink after
the window closes. However this would make all of the text in such a window
appear in the system font. As many programmers (myself included) use
Wimp_ReportError for message dialogs and queries, this would make DeskFonts
substantially useless. I will continue to work on this problem and may
produce an update in the future.
UPDATE: Option added to disable deskfonts during the display of an error
box. When on, the default system font is used within Wimp_Error dialogs,
outline font restored afterwards.
Text display is (naturally) quite a lot slower than with the normal system
font.
Text plotted when the plot option set to other than normal (EOR, AND OR
etc.) goes wrong. (Eg adding text to a sprite in !Paint). The only solution
at the moment is to disable DeskFonts.
There is a problem when text output is re-directed to a sprite (!Alarm is a
particulary bad example). I don't currently know if there is a way of
finding out if VDU output has been re-directed.
Those programs which use the up arrow symbol in menus to denote the use of
the SHIFT key will not display the arrow symbol unless the font currently
being used contains the correct symbol at the correct place. Currently none
of the fonts available do so.
The characters which need re-defining are -
&80 tick
&81 (from large to small icon)
&82 (from small to large icon)
&83 re-size window icon
&84 close window icon (x)
&85 move to back icon
&88 left arrow
&89 right arrow
&8A down arrow
&8B up arrow (this normally is the only one needed for RISC-OS 3 users)
I have roughly defined a variant on Corpus.Bold to include these characters.
Note that these definitions are VERY crude. Someone else is sure to do
something better. If they do then how about sending me a copy? Also, if you
are good at that sort of thing, how about defining a new monospaced outline
font for the desktop that looks better than Corpus? I've got the MDA fonts
that come with the PC emulator and they look even worse than Corpus.
How DeskFonts works
-------------------
The low level Relocatable module intercepts all calls to the operating
systems' Write character routine and re-directs the character to be printed
to the fontmanager. This is complicated by the fact that many calls to
OS_WriteC are NOT printable characters but moves, draws, colour changes etc.
The inital code can often seem to be followed by a normal ASCII character
but it MUST NOT be caught. The program gets round this by counting a
specific number of characters through after the reciept of such a VDU code.
It also has to check for two special cases even when it thinks that it's
recieved a normal character.
The first is when the computer is in VDU4 mode (ie when the user's pressed
f12). Such characters must be passed along to the standard OS_WriteC
The second is to check that VDU output has not been re-directed via a
mechinism known as VDUX_V which is used by the WindowManager to provide
anti-aliased text in an icon in the desktop.
Characters which are to be printed are stored in a buffer until a control
character is found. At this point the current graphics cursor position is
found the background colour of the area in which the text needs updating
found, and the string printed.
The program also has to check for and respond to Service calls to do with
mode changes, so that the font can be recomputed correctly.
The program also hooks on to the ColourTrans vector and looks for calls to
ColourTrans_SetGCOL. When one is detected the colour value is stored away
and this colour is the one used for the foreground of the anti-aliased text.
Star commands
-------------
All of the features of DeskFonts are provided by the DeskFonts relocatable
module. This module interfaces to the desktop via a number of star commands.
Short notes on these are given below. Similar help can be provided by
pressing f12 after DeskFonts has loaded and typing *Help DeskFonts
==> Help on keyword DeskFonts
Module is: Desk fonts 1.05 (25 Feb 1992) ⌐ Rob Davison 1992
Commands provided:
DFontON DFontOFF DFont DFontX DFontY DfontOffset DfontAlias
DFontAddx DfontOS DfontReset
==> Help on keyword DFontON
*DFontON intercepts future calls to OS_WriteC and prints subsequent text in
an anti-aliased font. Syntax: *DfontON
==> Help on keyword DFontOFF
*DFontOFF restores the default system font.
Syntax: *DfontOFF
==> Help on keyword DFont
*DFont sets the font to be used in the desktop after a *DFontON.
Syntax: *DFont <FontName>
==> Help on keyword DFontX
*DFontX sets the width of anti-aliased text in the desktop.
Syntax: *DFontX <pointsize*16>
==> Help on keyword DFontY
*DFontY sets the height of anti-aliased text in the desktop.
Syntax: *DFontY <pointsize*16>
==> Help on keyword DfontOffset
*DFontOffset sets the vertical offset of the anti-aliased text from the
normal text position. Syntax: *DFontOffset <os-units>
==> Help on keyword DfontAlias
*DfontAlias controls DeskFonts colour checking.
Syntax: *DFontAlias 0|1|2
==> Help on keyword DFontAddx
*DfontAddx sets the horizontal pixel offset between each character.
Syntax: *DfontAddx <os-units>
==> Help on keyword DfontOS
*DFontOS allows DeskFonts to cater for different versions of RISC-OS.
Syntax: *DFontOS 2|3
==> Help on keyword DfontReset
*DFontReset resets all of DeskFonts internal values to sensible defaults.
Syntax: *DFontReset