home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / education / a / identikey / !IdentiKey / Fonts (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1995-11-05  |  4KB  |  92 lines

  1.  Module Fonts
  2.  -----------------------------------------------------------------------
  3.  Fonts Handling Routines (version 1.04 05-Nov-95)
  4.  This library contains routines that handle outline fonts
  5.  -----------------------------------------------------------------------
  6.  Structure of Data used in this module
  7.  Public Methods Supported:
  8.    FN_shell_Fonts_Init                 Initialises module
  9.    FNshell_Fonts_GetDeskTopFont
  10.    FNshell_Fonts_FontIsAvailable
  11.    PROCshell_Fonts_FindFont
  12.    PROCshell_Fonts_ForgetFont
  13.    PROCshell_Fonts_SetColour
  14.  Responses to events raised by other modules
  15.    PROCshell_Fonts_DeskTopFont_Selected
  16.    PROCshell_Fonts_LoseFonts
  17.  Private Methods Supported:
  18.  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  19.  Public routines..
  20.  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  21. *|Start FN_shell_Fonts_Init
  22. _shell_Fonts_Init
  23. ()_c_Fonts_DeskTopFont_NotKnown%   = -1
  24. )(_c_Fonts_ReadDeskTopFont_Reason% = 8
  25. *E_c_Fonts_CurrentDeskTopFont%     = _c_Fonts_DeskTopFont_NotKnown%
  26. shell_ExReg_FontLib_Loaded
  27. *|Stop FN_shell_Fonts_Init
  28. 4(*|Start FNshell_Fonts_GetDeskTopFont
  29. shell_Fonts_GetDeskTopFont
  30.  Only make SWI call if desktop font handle has not already been
  31.  read - the cached value of the font handle will be updated if
  32.  the user selects a new desktop font. If the version of the OS
  33.  is earlier than 3.5 then the SWI returns 0 as the font handle
  34.  which should be interpreted by the user application as 'System
  35.  Font'.
  36.  _c_Fonts_CurrentDeskTopFont% = _c_Fonts_DeskTopFont_NotKnown% 
  37.  "XWimp_ReadSysInfo", _c_Fonts_ReadDeskTopFont_Reason% 
  38.  _c_Fonts_CurrentDeskTopFont%
  39. D"= _c_Fonts_CurrentDeskTopFont%
  40. F'*|Stop FNshell_Fonts_GetDeskTopFont
  41. J$*|Start PROCshell_Fonts_FindFont
  42. shell_Fonts_FindFont( font$, x_pt, y_pt, 
  43.  font_handle% )
  44.  flags%
  45.  "XFont_FindFont",,font$,x_pt*16,y_pt*16,0,0 
  46.  font_handle%;flags%
  47.  flags% 
  48.   font_handle% = 0
  49. W#*|Stop PROCshell_Fonts_FindFont
  50. [)*|Start FNshell_Fonts_FontIsAvailable
  51. shell_Fonts_FontIsAvailable( font$, x_pt, y_pt )
  52.  "Font_FindFont", 0, font$, x_pt*16, y_pt*16, 0, 0 
  53.  font_handle%
  54.  "Font_LoseFont", font_handle%
  55. e(*|Stop FNshell_Fonts_FontIsAvailable
  56. i%*|Start PROCshell_Fonts_SetColour
  57. j;*|!PROCshell_Fonts_SetColour( foreground , background )
  58. l@*|!This procedure sets the colours used for plotting outline
  59. mA*|!fonts. Each of the specified colours is given as a word of
  60. nB*|!the form &BBRRGG00. Note that the routine FNdraw_colour can
  61. oC*|!be used to generate a word of this form from separate values
  62. *|!for red, green and blue.
  63. shell_Fonts_SetColour( fore%, back% )
  64.  "ColourTrans_SetFontColours", 0, back%, fore%, 14
  65. t$*|Stop PROCshell_Fonts_SetColour
  66. y&*|Start PROCshell_Fonts_ForgetFont
  67. shell_Fonts_ForgetFont( font_handle% )
  68.  "Font_LoseFont", font_handle%
  69. }%*|Stop PROCshell_Fonts_ForgetFont
  70.  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  71.  Responses to events raised by other modules..
  72.  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  73. %*|Start PROCshell_Fonts_LoseFonts
  74. shell_Fonts_LoseFonts
  75.  loop%,temp%
  76. temp%=_U%!232
  77.  loop%=0 
  78.  temp%?loop%>0
  79.  "Font_LoseFont",loop%
  80.   temp%?loop%-=1
  81.  loop%
  82. $*|Stop PROCshell_Fonts_LoseFonts
  83. 0*|Start PROCshell_Fonts_DeskTopFont_Selected
  84. shell_Fonts_DeskTopFont_Selected( font_handle% )
  85.  Message_FontChanged received, so cache the new font
  86.  handle for use later..
  87. /_c_Fonts_CurrentDeskTopFont% = font_handle%
  88. /*|Stop PROCshell_Fonts_DeskTopFont_Selected
  89.  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  90.  Private module routines
  91.  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  92.