home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 551-575 / apd562 / readme.doc < prev   
Text File  |  1990-10-20  |  9KB  |  228 lines

  1.  
  2.                                FontUte 1.1
  3.  
  4.                          by Gary O'Connor Nov/90
  5.  
  6.       Selecting a font for your programmes is a very important job. The
  7.  right font can `make or break' the appearance of your screens.
  8.  
  9.       Amos makes it easy to use your disc fonts, with the `Get Fonts' and
  10.  the `Set Font' commands, but you can only `Get Fonts' from the currently
  11.  `ASSIGN'ed `fonts' directory.
  12.  
  13.       At startup, AmigaDos ASSIGNs `fonts' to the `fonts' directory on your
  14.  boot disc (if it has a `fonts' directory), so you can only `Get Fonts' from
  15.  that disc. If you want a different font, you have to copy it to your boot
  16.  disc before you can use it.
  17.  
  18.       FontUte gets around this problem by using the Amos function called
  19.  `DOSCALL'. (See page 287 in your manual)
  20.  
  21.       `DOSCALL' allows you to use the DOS functions from within an Amos
  22.  programme. It is relatively easy to use, provided you have some knowledge
  23.  of Assembly Language methods. Don't let that frighten you, it's not really
  24.  that hard.
  25.  
  26.       I will be explaining how to use it in an Amos Users Club newsletter
  27.  in the near future.
  28.  
  29.       FontUte uses `DOSCALL' to assign `fonts' to the directory of any
  30.  disc you choose from the Menu, and then calls `Get Fonts'. It then uses the
  31.  `Font$' function to sort out the information needed to make the Fonts menu.
  32.  (see pages 106 and 107 in your manual). This version of the programme will
  33.  create menus for up to 58 different fonts, if you have that many in a
  34.  `fonts' directory.
  35.  
  36.       All you need do, after that, is select a font from the Fonts menu and
  37.  it will be displayed on the screen in LowRes.
  38.  
  39.       You can change the `Pen' and `Paper' colours by clicking on the
  40.  buttons at the bottom of the screen and, if you want to see what the font
  41.  would look like in HiRes, simply click the left Mouse Button and you have
  42.  it. Clicking the left Mouse button toggles the display between Low and
  43.  Hires.
  44.  
  45.       The Hires screen will automatically disappear as you move the Mouse to
  46.  the top of the display, unless you have your finger on the right Mouse
  47.  button. If you have done this and you select a menu, some of it will be
  48.  obscured by the Hires screen.
  49.  
  50.       Once you have selected a font, the `Sel' menu will be adjusted to
  51.  show you the
  52.       (1) Currently selected font.
  53.       (2) The Source disc for that font and
  54.       (3) The Currently selected disc.
  55.  
  56.       When you find a font you like, go to the last menu and you can save it
  57.  in a variety of ways.
  58.  
  59.                          (1) Font to Disc.
  60.       This is ideal if you have two disc drives or more. It loads the font
  61.  from the source disk and puts it straight on to the disc you want it to go
  62.  to.
  63.  
  64.                          (2) Font to ram.
  65.       If you only have one drive, this option will make a fonts directory
  66.  in ram:, to which you can add as many fonts as you like, and then use the
  67.  third option.
  68.  
  69.                          (3) Ram to Disc.
  70.       As the name implies this option will dump a fonts directory from ram:
  71.  to the destination disc of your choice.
  72.  
  73.       In all cases the save options carry out a series of checks to ensure
  74.  you don't corrupt a disc, and to make things easy for you by creating any
  75.  directories that are necessary.
  76.  
  77.       First of all the programme checks the size of the space it needs to
  78.  complete the transfer. It then compares that against the free space on your
  79.  destination disc, in the case of selections 1 and 3, or the available
  80.  memory for selection 2. If there is insufficient space available, it aborts
  81.  on selection 2 and gives you the option of selecting another destination
  82.  disc for selections 1 and 3.
  83.  
  84.       Once it is satisfied that there is enough room, it checks to see if
  85.  the destination drive has a `fonts' directory. If it doesn't, one is
  86.  created and the process continues. It looks to see if there is a directory,
  87.  in the `fonts' directory for the selected font. If it doesn't find one it
  88.  creates one etc. etc.
  89.  
  90.       In short, you don't have to know anything about creating directories
  91.  to put the font you want on the disc you want it to be on.
  92.  
  93.       The programme is based around the `DOSCALL' function and makes use of
  94.  the ability to activate CLI commands from within an Amos programme. There
  95.  are a couple of things you have to do, however, before you can actually
  96.  do this.
  97.  
  98.       (1) YOU MUST NOT CLOSE THE CLI ON STARTUP!
  99.       (2) YOU MUST HAVE A `C' DIRECTORY THAT CONTAINS THE DESIRED COMMANDS!
  100.  
  101.       It works this way.
  102.  
  103.       You create a `string' that contains the Command string, just as you
  104.  would type it into the CLI.
  105.  
  106.      A normal CLI command string might look like this
  107.  
  108. 1> assign fonts: df2:fonts
  109.  
  110.      This would assign `fonts' to the `fonts' directory on the disc in drive
  111.  two. The Amos string equivalent would be
  112.  
  113. CD$="assign fonts: df2:fonts"+CHR$(0)
  114.  
  115.      As you can see, it is basically the same string only we have given it a
  116.  name and we've added a CHR$(0) to the end.
  117.  
  118.      The reason for the CHR$(0) is that AmigaDos looks for that character to
  119.  establish where the string ends.
  120.  
  121.      Now here's the good bit......
  122.  
  123.      If you follow the above rules, you can use the `DDOS' Procedure from
  124.  this programme to activate your own CLI commands. Just highlight the
  125.  Procedure and save it. Then you can use it in any programme you wish. You
  126.  will have to do a couple of other things.
  127.  
  128.      At the start of your programme, after any `DIM' statements, type in
  129.  this line
  130.  
  131. Global CD$,R
  132.  
  133.      When you make a command string, always call it CD$. The `R' variable
  134.  is returned by DOSCALL. If `R=-1' the call was successful.
  135.  
  136.            BUGS, OTHER ANNOYANCES and THINGS OF INTEREST in FontUte!
  137.  
  138.  (1)     For some reason, `ASSIGN' does not work from Amos on all discs that
  139.     do have a `fonts' directory.
  140.  
  141.          I don't know why.
  142.  
  143.          It doesn't mean that there's something wrong with the disc because
  144.     if you try to `ASSIGN' `fonts' to the disc from the CLI, it works
  145.     perfectly well.
  146.  
  147.          It will not work on any disc that has it's `fonts' directory
  148.     created from this programme, but it will work on a `fonts' directory
  149.     that this programme has created in ram:.
  150.  
  151.          Do not panic. Any directory created by this programme will work
  152.     perfectly in your programmes.
  153.  
  154.  (2)     Amos does something really interesting with fonts you have
  155.     selected. So long as you have not changed discs, everything works
  156.     beautifully, but, when you do change discs and select a font, whammo!
  157.     it loads the last font you selected from the previous disc into Font$(3)
  158.     and it cannot be disloged from that position until you change discs
  159.     again. Then it does it all over again with the disc you just removed.
  160.  
  161.          That is why you will notice, if you are keen enough, that the font
  162.     numbers on the menu will go, once you change discs,
  163.  
  164.     1
  165.     2
  166.     4
  167.     etc.
  168.  
  169.          The reason I've done that is because, were you to select `Font 3',
  170.     after you had changed discs, the programme will crash!
  171.  
  172.          I'll fix it in the next version.
  173.  
  174.       Have you ever used the `Exist' function to find out which drives are
  175.  connected?
  176.  
  177.       Did it annoy you when you found out that, unless there is a disc in
  178.  the drive when you test it, it says that drive doesn't exist?
  179.  
  180.       This programme uses `DOSCALL' to activate the CLI's `Info' function
  181.  and then sifts that information to establish which drives are connected,
  182.  whether they have a disc in them or not!
  183.  
  184.       To use any CLI function that gives you a readout on the CLI, from
  185.  Amos, you must send the output of the CLI function to a file. Then you
  186.  read that file to glean the wanted information.
  187.  (see the MENINF, CHKASSIGN and SIZES Procedures for an example.)
  188.  
  189.       A normal call, from the CLI would look like this
  190.  
  191. 1> Info
  192.  
  193.       This would print you out a list of attached drives and devices as well
  194.  as other valuable information.
  195.  
  196.       The same call, to use the `DDOS' Procedure, would look like this
  197.  
  198. CD$="Info >ram:InfoFile"+CHR$(0)
  199.  
  200.       This redirects the output of the Info function to the file
  201.  ram:InfoFile, and you get your information from that.
  202.  
  203.       This programme uses the CLI functions
  204.  
  205.    Info:   To establish which drives are connected and the Disc Names!
  206.  
  207.    ASSIGN: To assign fonts and to check that the ASSIGN function worked!
  208.  
  209.    List:   To get file size information!
  210.  
  211.  
  212.  
  213.                         WR-WR-WR-WR-WRAP UP!
  214.  
  215.       I hope this programme is of use to you and I ask you to study the
  216.  code. Maybe you can improve it, and if you can please do so!
  217.  
  218.       If you like any of the code then take it and use it.
  219.  
  220.       Amos is a great language!
  221.  
  222.       Happy programming!
  223.  
  224.                                             Gary O'Connor
  225.  
  226.                                             Membership number 353.
  227.  
  228.