home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
education
/
a
/
identikey
/
!IdentiKey
/
Fonts
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1995-11-05
|
4KB
|
92 lines
Module Fonts
-----------------------------------------------------------------------
Fonts Handling Routines (version 1.04 05-Nov-95)
This library contains routines that handle outline fonts
-----------------------------------------------------------------------
Structure of Data used in this module
Public Methods Supported:
FN_shell_Fonts_Init Initialises module
FNshell_Fonts_GetDeskTopFont
FNshell_Fonts_FontIsAvailable
PROCshell_Fonts_FindFont
PROCshell_Fonts_ForgetFont
PROCshell_Fonts_SetColour
Responses to events raised by other modules
PROCshell_Fonts_DeskTopFont_Selected
PROCshell_Fonts_LoseFonts
Private Methods Supported:
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Public routines..
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*|Start FN_shell_Fonts_Init
_shell_Fonts_Init
()_c_Fonts_DeskTopFont_NotKnown% = -1
)(_c_Fonts_ReadDeskTopFont_Reason% = 8
*E_c_Fonts_CurrentDeskTopFont% = _c_Fonts_DeskTopFont_NotKnown%
shell_ExReg_FontLib_Loaded
*|Stop FN_shell_Fonts_Init
4(*|Start FNshell_Fonts_GetDeskTopFont
shell_Fonts_GetDeskTopFont
Only make SWI call if desktop font handle has not already been
read - the cached value of the font handle will be updated if
the user selects a new desktop font. If the version of the OS
is earlier than 3.5 then the SWI returns 0 as the font handle
which should be interpreted by the user application as 'System
Font'.
_c_Fonts_CurrentDeskTopFont% = _c_Fonts_DeskTopFont_NotKnown%
"XWimp_ReadSysInfo", _c_Fonts_ReadDeskTopFont_Reason%
_c_Fonts_CurrentDeskTopFont%
D"= _c_Fonts_CurrentDeskTopFont%
F'*|Stop FNshell_Fonts_GetDeskTopFont
J$*|Start PROCshell_Fonts_FindFont
shell_Fonts_FindFont( font$, x_pt, y_pt,
font_handle% )
flags%
"XFont_FindFont",,font$,x_pt*16,y_pt*16,0,0
font_handle%;flags%
flags%
font_handle% = 0
W#*|Stop PROCshell_Fonts_FindFont
[)*|Start FNshell_Fonts_FontIsAvailable
shell_Fonts_FontIsAvailable( font$, x_pt, y_pt )
"Font_FindFont", 0, font$, x_pt*16, y_pt*16, 0, 0
font_handle%
"Font_LoseFont", font_handle%
e(*|Stop FNshell_Fonts_FontIsAvailable
i%*|Start PROCshell_Fonts_SetColour
j;*|!PROCshell_Fonts_SetColour( foreground , background )
l@*|!This procedure sets the colours used for plotting outline
mA*|!fonts. Each of the specified colours is given as a word of
nB*|!the form &BBRRGG00. Note that the routine FNdraw_colour can
oC*|!be used to generate a word of this form from separate values
*|!for red, green and blue.
shell_Fonts_SetColour( fore%, back% )
"ColourTrans_SetFontColours", 0, back%, fore%, 14
t$*|Stop PROCshell_Fonts_SetColour
y&*|Start PROCshell_Fonts_ForgetFont
shell_Fonts_ForgetFont( font_handle% )
"Font_LoseFont", font_handle%
}%*|Stop PROCshell_Fonts_ForgetFont
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Responses to events raised by other modules..
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%*|Start PROCshell_Fonts_LoseFonts
shell_Fonts_LoseFonts
loop%,temp%
temp%=_U%!232
loop%=0
temp%?loop%>0
"Font_LoseFont",loop%
temp%?loop%-=1
loop%
$*|Stop PROCshell_Fonts_LoseFonts
0*|Start PROCshell_Fonts_DeskTopFont_Selected
shell_Fonts_DeskTopFont_Selected( font_handle% )
Message_FontChanged received, so cache the new font
handle for use later..
/_c_Fonts_CurrentDeskTopFont% = font_handle%
/*|Stop PROCshell_Fonts_DeskTopFont_Selected
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Private module routines
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::