home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsf / fontpool / PoolHelp / HelpData next >
Encoding:
Text File  |  1995-01-12  |  15.3 KB  |  345 lines

  1. FontPool_Hello
  2.   In:   R1 = <Configuration word=>FontPool_Hello_R1> (same as <FontPool_Configure>)
  3.  
  4.   Out:  R0 -> Menu-pointer.
  5.  
  6. Every client should call this SWI once on startup. R1 overwrites
  7. any earlier configuration that might be present if bit#31 is set
  8. - else R1 is ignored and the previous configuration reigns. Note
  9. that the value for '<alphabetisation=>Alphabetize>' won't come into effect
  10. until the font-menu is next built. Calling this SWI by itself
  11. does not automatically re-generate the menu. To force it to be
  12. re-buildt, use FontPool_Configure.
  13.  
  14. <Using FontPool_Hello..=>Using_FontPool_Hello>FontPool_Goodbye
  15.   In:  -
  16.  
  17.   Out: -
  18.  
  19. If there are no more clients using FontPool,
  20. the internal menu-structure is forgotten and
  21. the memory is returned to the RMA.
  22.  
  23. <Using FontPool_Goodbye..=>Using_FontPool_Hello>FontPool_Configure
  24.   In:   R1 = <Configuration word=>FontPool_Hello_R1> (same as <FontPool_Hello>)
  25.         R2 = <TRUE=>FontPool_Configure_R2>  => The menu is rebuilt instantly by (re-)reading the
  26.                       available fonts from disc.
  27.            = FALSE => the menu is not rebuilt until FontPool detects a change
  28.                       in the number of available fonts.
  29.         R3 -> FontName for font-menu font. If system-font is required R3
  30.               should point to a null-string.
  31.            =  0 => Ignored!
  32.         R4 =  &<xxx=>xxxyyy><yyy=>xxxyyy><hh>  where
  33.                  xxx = x-point size (*16)
  34.                  yyy = y-point size (*16)
  35.                   hh = Menu-item height.
  36.               R4 is used only if R3 is not 0!
  37.  
  38.   Out:  R0 -> <Possibly new menu-pointer=>PossiblyNewMenuPtr>.
  39.  
  40. The menu MUST be rebuilt if changes to the <alphabetisation value=>Alphabetize> is to come
  41. into effect. This means that bit#31 of the configuration word (in R1) must be
  42. set and R2 must be TRUE. (The alphabetisation value is the only parameter that
  43. requires the font-menu to be rebuilt before it is actually applied to the
  44. menu.)
  45.  
  46. If an anti-aliased font is specified it overrides any forground and background
  47. colours that might be configured - forcing them to be black on white.
  48.  
  49. <Using FontPool_Configure..=>Using_FontPool_Configure>FontPool_CreateMenu
  50.   In:   R1 can be any of the following:
  51.            = Handle of font to be ticked
  52.            ->FontName  (This is necessary because the old font manager
  53.                        maps font-handles to different names than what
  54.                        is produced by Font_ListFonts.)
  55.            = -1 => do not tick any
  56.            =  0 => do not tick any
  57.         R2 = x of top-left corner of menu.
  58.         R3 = y..
  59.         R4 ->Parent menu or
  60.            = 0 => use font-menu directly.
  61.  
  62.   Out:  R0 -> <Possibly new menu-pointer=>PossiblyNewMenuPtr>
  63.  
  64. R4 might seem superflous, but it is meant to be used if the user does
  65. a menu-selection with ADJUST (to make the menu stay on screen) and the
  66. font-menu was opened with <FontPool_CreateSubMenu>. You then specify the
  67. root-menu in R4 to reproduce the full menu-structure.
  68.  
  69. <Using FontPool_CreateMenu..=>Using_FontPool_CreateMenu>FontPool_CreateSubMenu
  70.   In:   R1 can be any of the following:
  71.            = Handle of font to be ticked
  72.            ->FontName
  73.            = -1 => do not tick any
  74.            =  0 => do not tick any
  75.         R2 = x of top-left corner of menu.
  76.         R3 = y..
  77.         R4 ->Parent menu or
  78.            = 0 => use font-menu directly.
  79.  
  80.   Out:  R0 -> <Possibly new menu-pointer=>PossiblyNewMenuPtr>
  81.  
  82. If R1 > 255 on entry it is taken as a pointer to a font-name,
  83. else it is either a font-handle or null. R1 can also point to a
  84. null-string in which case it is the same as calling with R1=0.
  85.  
  86. <Using FontPool_CreateSubMenu..=>Using_FontPool_CreateSubMenu>FontPool_MenuSelection
  87.   In:   R1 ->Menu data-structure. or
  88.            = 0 => The top level menu was the font-menu itself.
  89.         R2 ->Block as returned by Wimp_Poll(9) - list of MenuSelections
  90.         R3 ->Buffer where to put FontName or
  91.            = 0 => Use internal buffer for FontName and return pointer in R3.
  92.  
  93.   Out:  If the exact menu-item you selected was ticked then
  94.            R0 = FALSE (can be regarded as if the system font is selected)
  95.            R3 = bogus (actually ->FontName on entry)
  96.         else
  97.            R0 = TRUE
  98.            R3 ->FontName (which might be the same as given on entry)
  99.  
  100. If it is deduced that the user clicked on an item not in the font-menu, it will
  101. be taken as a deselect-all-fonts command (ie. it returns with R0=FALSE & R3=?).
  102.  
  103. If R3=0 on entry a copy of the returned name should be taken since the internal
  104. buffer might be overwritten.
  105.  
  106. <Using FontPool_MenuSelection..=>Using_FontPool_MenuSelection>FontPool
  107. SWIs available in
  108. FontPool v0.12
  109.  
  110. #Prefix FontPool_
  111.  <Hello        >
  112.  <Goodbye      >
  113.  <Configure    >
  114.  <CreateMenu   >
  115.  <CreateSubMenu>
  116.  <MenuSelection>
  117. - - - - - - - - -
  118.  <Terms of use =>TermsOfUse>R4=&xxxyyyhh 
  119. xxx = x-point size (*16)
  120. yyy = y-point size (*16)R4=&xxxyyyhh
  121. hh = Menu-item height. Since small values would make the
  122.      menu unreadable, values 0 through 7 are reserved for
  123.      special actions:
  124.  
  125.    = 0 => check strings before deciding height (will be
  126.           somewhat more compact than =1).
  127.    = 1 => use natural font-height (line-spacing)
  128.  
  129.        The difference between a value of 0 and 1 becomes
  130.        apparent if you try eg. the font 'Portrhouse.Standard'
  131.        (at size 10).
  132.  
  133.    2-7 are reserved for future expansion. (Might in the
  134.        future be used to specify if the given font should
  135.        apply to either selected or unselected menu-items.
  136.        This way the selected font can be 'highlighted' by
  137.        using bold or italic.)
  138.  
  139. So values above 7 are taken as explicit menu-item height.Using FontPool_Hello & FontPool_Goodbye
  140. When <FontPool_Hello> is called (which would in most cases
  141. be when an application starts up), the internal font-menu
  142. is built (and the memory 'shrinkwrapped' around it). It
  143. is only built, of course, if no font-menu already exists
  144. in memory. Calling FontPool_Hello also increases an
  145. internal 'client-counter'. This counter is decreased when
  146. <FontPool_Goodbye> is called. FontPool_Goodbye should be
  147. called when an application no longer needs the services
  148. of FontPool (eg. when the application terminates). So
  149. when there are no more FontPool clients, the internal
  150. font-menu is forgotten about, and the memory occupied by
  151. the font-menu is returned to the RMA.
  152.  
  153. <Note..=>NOTE1>Using FontPool_CreateMenu
  154. When an application wants to show the font-menu directly,
  155. FontPool_CreateMenu would be called. This is similar to
  156. calling Wimp_CreateMenu and simply displays the full menu at
  157. the coordinates specified. In addition to the screen-position,
  158. FontPool can be instructed to tick a specified font (eg. the
  159. applications current font). This is done by either inputting
  160. the font's handle or its name (as read by Font_ListFonts, and
  161. also returned by <FontPool_MenuSelection>). If a handle is
  162. given, it is converted to a font-name by means of
  163. Font_ReadDefn. The name is then matched with those currently
  164. available in the internal font-menu. If a match is detected,
  165. the font is ticked (and possibly coloured).
  166.  
  167. NOTE that the font-handle way is not safe with old
  168. FontManagers. This is because Font_ReadDefn might return a
  169. different name than Font_ListFonts did when reading in the
  170. menu. The net result is that no font will then be ticked.
  171. So for compatibility - use the font-name when instructing
  172. FontPool to tick a font.
  173.  
  174. <Note..=>NOTE1>Using FontPool_CreateSubMenu
  175. FontPool_CreateSubMenu makes it possible to attach the
  176. font-menu to another menu-item in a higher level menu
  177. (this would in most cases be the way applications show
  178. their font-menu). Since the available fonts might change
  179. between calls to FontPool (because the Font$Path has
  180. changed) FontPool_CreateSubMenu should be called as a
  181. result of a Msg_SubMenuWarning. Ie. the menu-entry that
  182. is to reveal the font-menu should have bit#3 in its item-
  183. flags set so that the wimp generates a message when the
  184. mouse moves over the item.
  185.  
  186. <Note..=>Note1>Using FontPool_MenuSelection
  187. When the application detects a menu-selection in the font-menu it should call
  188. FontPool_MenuSelection with pointers to both the menu-structure and the block
  189. returned by Wimp_Poll (reason code 9 - list of menu-selections). The
  190. menu-structure pointer can be 0 if the font-menu was opened directly (ie. by
  191. using <FontPool_CreateMenu>). If it was opened indirectly (by the
  192. <FontPool_CreateSubMenu> procedure) you need to input the pointer to the
  193. root-menu (which is one the application has created itself). This is so
  194. FontPool can make sense of the list of menu-selections that is returned in
  195. Wimp_Poll and return the correct font-name. On exit from FontPool_MenuSelection
  196. you are told if there is a font ticked, and if there is, the name of the font
  197. is returned. Note that if the user selects (clicks) the item the font-menu is
  198. attached to (ie. one level above the actual font-menu) it is taken as a
  199. deselect-all-fonts command. This is deduced by the list of menu-selections
  200. passed to FontPool_MenuSelection.
  201.  
  202. Be aware that it is completely up to the application programmer to decide what
  203. to do when FontPool_MenuSelection returns telling you that there is no font
  204. currently selected (when the user clicked on an already selected font). The
  205. programmer could then either 'keep' the currently selected font, and pass it on
  206. to FontPool the next time the menu is opened to make sure it is ticked. Or (s)he
  207. could use this as an indication that the system-font should be used instead.
  208.  
  209. FontPool keeps no internal reference of which font is currently selected (since
  210. there can be many clients). This gives more freedom to the programmer.
  211.  
  212. <Note..=>NOTE2>Using FontPool_Configure
  213. This SWI allows you to change FontPool's configuration
  214. at any time. Keep in mind though that changing the
  215. configuration will affect all applications using
  216. FontPool! This might sound as a drawback at first, but
  217. the user is actually likely to want the font-menu to
  218. look similar (if not identical) in all applications.
  219.  
  220. Also note that FontPool_Configure is the only call
  221. that can alter the font used when displaying the menu.
  222.  
  223. <Note..=>NOTE1>FontPool_Configure R2
  224. You can force the menu to be re-built at ANY time without
  225. changing the configuration by calling with R1=0 (actually
  226. bit#31 clear) and R2=TRUE. This is to aid RISC OS 3
  227. programmers. This feature would only be rarely needed
  228. since re-reading the menu is probably best deferred until
  229. the user actually needs to access the font-menu (ie. when
  230. either of <FontPool_CreateMenu> or <_CreateSubMenu=>FontPool_CreateSubMenu> is called).Configuration word
  231. If bit#31 of this word is clear the whole word is ignored, otherwise
  232. the following applies:
  233.  
  234.    bits#0-3    fg col to use on selected items     def. 7
  235.    bits#4-7    bg..                                def. 0
  236.    bits#8-11   fg col to use on unselected items   def. 7
  237.    bits#12-15  bg..                                def. 0
  238.  
  239.       The selected menu-items will always be ticked - even if the
  240.       specified colour is not the default.
  241.  
  242.    bits#16-19  '<Alphabetize value=>Alphabetize>' for the menu.   def. 12
  243.                This is to make the programmer able to reconfigure the
  244.                font-menu if a user with eg. a huge multisync screen
  245.                should want a longer menu.
  246.    bits#20-30  Reserved. Set to 0!
  247.    bit#31      must be set or this word is ignored!Alphabetize value
  248. The alphabetize value specifies how long the menu
  249. can grow before font-families starting with the
  250. same initial character are collected in a sub-menu.
  251.  
  252. The value is specified in menu-items.Possibly new menu-pointer
  253. Possibly new menu-pointer means that the full
  254. menu could not be held in the 'old' RMA-block.
  255. This will only happen if the menu is re-build
  256. due to a change in the Font$Path.NOTE1
  257. Two points concerning FontPool_Hello, _Configure, _CreateMenu and
  258. _CreateSubMenu:
  259.  
  260. 1) They might return with an error if the FontManager is not
  261. available, or the Font$Path is stupid. This error should probably
  262. be trapped (and ignored) during the startup-process of the
  263. application (_Hello). If not, the application is likely to
  264. terminate before it has got its wheels in motion.
  265.  
  266. 2) On exit a pointer to the internal menu-structure is returned.
  267. This is important to note if you are displaying the menu by means
  268. of <FontPool_CreateSubMenu> since the submenu-pointer should be
  269. updated in the relevant higher level menu-item. If this is not
  270. done <FontPool_MenuSelection> can go horribly wrong !!  The pointer
  271. can change between these calls due to more fonts becoming
  272. available.NOTE2
  273. If the user selects (clicks) on a non-leaf item in the
  274. menu - and the item is not selected (ticked), it is
  275. regarded as selecting the top-most item(s) in the rest
  276. of the selected item's submenu(s). So clicking directly
  277. on the item 'Trinity' is regarded as selecting
  278. 'Trinity.Bold.(Plain)', and the font-name returned from
  279. FontPool_MenuSelection will be 'Trinity.Bold'.Terms of use
  280. FontPool costs nothing unless you use its facilities in
  281. a program. Once you do, you should decide what category
  282. your program fall under (see below) and pay <me=>Me> at least
  283. this minimum charge. If you find FontPool exceptionally
  284. useful you are of course welcome to pay more, and if
  285. this sum is at least MinimumCharge+£5 you will
  286. automatically receive the next version of FontPool as
  287. soon as it becomes available. To prevent the nuicance
  288. of royalties I have adobted the following scheme:
  289.  
  290.    <Personal use..=>PersonalUse>
  291.  
  292.    <Shareware..   =>SharewareUse>
  293.  
  294.    <Commercial..  =>CommercialUse>Personal use:
  295. If you are using FontPool in your own personal
  296. programs or programs that are distributed free
  297. of charge, you should pay a minimum of £5. This
  298. sum covers ALL such programs that originate
  299. from the buyer.
  300.  
  301. <Distribution note..=>DistributionNote>Shareware:
  302. If you are using FontPool in Shareware programs, or any
  303. type of program you charge for, you should pay at least
  304. £10. This sum covers ALL such programs that originate
  305. from the buyer, and also those mentioned under <Personal=>PersonalUse>
  306. <use=>PersonalUse>.
  307.  
  308. An alternative is a swap. If you have produced something
  309. that you think I might find useful (and with a low bug-
  310. count) we could do an old-fashioned swap. (Then let me
  311. know what it is through Arcade before sending anything.)
  312.  
  313. <Distribution note..=>DistributionNote>Commercial:
  314. If you are using FontPool in a commercial application
  315. it costs £20 for each DIFFERENT application using it.
  316. The application's name must then be given when
  317. <registering=>Me>. £50 buys the right to use FontPool
  318. in all present and future commercial applications
  319. that originate from the buyer.Distribution note
  320. If FontPool is used as a part of a program that is distributed as
  321. public domain, Shareware or any such derivative, FontPool may be
  322. enclosed in two ways:
  323.  
  324.  - You state clearly in your documentation that your program utilises
  325.    FontPool's font-menu facilities and that FontPool is a Shareware
  326.    utility. Also it should say from what general source your copy of
  327.    FontPool originated (what BBS or Shareware library). You are then
  328.    allowed to enclose JUST the FontPool module by itself with NONE of
  329.    the other files.
  330.  
  331.  - You enclose a FULL copy of FontPool with ALL associated files in an
  332.    UNMODIFIED state.Registering:
  333. To register as a FontPool user, state your program's 
  334. category and send money to the following address:
  335.  
  336.    Eirik Hansen
  337.    Industriveien 12
  338.    8500 Narvik
  339.    Norway
  340.  
  341. I can also be contacted at Arcade where I'm user #440
  342. (private mail please). Your comments and suggestions
  343. are very much appreciated! Especially if you think
  344. there are dissuasive shortcomings that prevents you
  345. from using FontPool.