Home » Archimedes archive » Acorn Computing » 1994 11 subscription disc.adf » 9411s » FontMgr2/!FontMGR2/TechText/UsingIt

FontMgr2/!FontMGR2/TechText/UsingIt

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn Computing » 1994 11 subscription disc.adf » 9411s
Filename: FontMgr2/!FontMGR2/TechText/UsingIt
Read OK:
File size: 073D bytes
Load address: 0000
Exec address: 0000
File contents
Using the Font Manager from your own Applications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--------------------------------------------------

Because I have made it so very easy for you to
create your own Font Manager scripts, it should
not be too much trouble to integrate it's
functions into your own applications.  What goes
hand-in-hand with this is the freedom I have
given you to supply this application with your
own software packages.  This means that you can
be sure the user of your software has !FontMGR2.

--------------------------------------------------

Technically, scripts are delt with in the file
"!FontMGR2".TechText.Scripts", but I would like
to now point out how you might use the script
to your application's advantage.

Because most applications seem to check which
fonts are avliable each time they present the
user with a menu, any changes made with !FontMGR2
are reflected in the application's menu.  This
side of things is in essence "dealt with".

However if your application is given a file that
makes use of fonts that are in passive groups,
then those fonts *ARE* present, but are just
hideen from your application.  What I suggest
you do, is to check if !FontMGR2 is running.
This can be done easily by reading in the value
of the system variable <F$Running>.  It's
value will be either "TRUE" or "FALSE".  If it's
"TRUE" then "Filer_Run" a script file containing
a "font hunt" of the fonts you require.  If
!FontMGR2 isn't running then run the file within
the FontMGR2 resources directory entitled,
"BootFonts".  It's syntax is:

 BootFonts <filename>

If the filename is omitted, it will set up as
default.  BootFonts will accept font hunts.

If the system variable "<FontMGR2$Dir>" is not
present then obviously the user doesn't use
!FontMGR2 - silly.

--------------------------------------------------

00000000  55 73 69 6e 67 20 74 68  65 20 46 6f 6e 74 20 4d  |Using the Font M|
00000010  61 6e 61 67 65 72 20 66  72 6f 6d 20 79 6f 75 72  |anager from your|
00000020  20 6f 77 6e 20 41 70 70  6c 69 63 61 74 69 6f 6e  | own Application|
00000030  73 0a 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |s.~~~~~~~~~~~~~~|
00000040  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |~~~~~~~~~~~~~~~~|
*
00000060  7e 7e 7e 0a 0a 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |~~~..-----------|
00000070  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000090  2d 2d 2d 2d 2d 2d 2d 0a  0a 42 65 63 61 75 73 65  |-------..Because|
000000a0  20 49 20 68 61 76 65 20  6d 61 64 65 20 69 74 20  | I have made it |
000000b0  73 6f 20 76 65 72 79 20  65 61 73 79 20 66 6f 72  |so very easy for|
000000c0  20 79 6f 75 20 74 6f 0a  63 72 65 61 74 65 20 79  | you to.create y|
000000d0  6f 75 72 20 6f 77 6e 20  46 6f 6e 74 20 4d 61 6e  |our own Font Man|
000000e0  61 67 65 72 20 73 63 72  69 70 74 73 2c 20 69 74  |ager scripts, it|
000000f0  20 73 68 6f 75 6c 64 0a  6e 6f 74 20 62 65 20 74  | should.not be t|
00000100  6f 6f 20 6d 75 63 68 20  74 72 6f 75 62 6c 65 20  |oo much trouble |
00000110  74 6f 20 69 6e 74 65 67  72 61 74 65 20 69 74 27  |to integrate it'|
00000120  73 0a 66 75 6e 63 74 69  6f 6e 73 20 69 6e 74 6f  |s.functions into|
00000130  20 79 6f 75 72 20 6f 77  6e 20 61 70 70 6c 69 63  | your own applic|
00000140  61 74 69 6f 6e 73 2e 20  20 57 68 61 74 20 67 6f  |ations.  What go|
00000150  65 73 0a 68 61 6e 64 2d  69 6e 2d 68 61 6e 64 20  |es.hand-in-hand |
00000160  77 69 74 68 20 74 68 69  73 20 69 73 20 74 68 65  |with this is the|
00000170  20 66 72 65 65 64 6f 6d  20 49 20 68 61 76 65 0a  | freedom I have.|
00000180  67 69 76 65 6e 20 79 6f  75 20 74 6f 20 73 75 70  |given you to sup|
00000190  70 6c 79 20 74 68 69 73  20 61 70 70 6c 69 63 61  |ply this applica|
000001a0  74 69 6f 6e 20 77 69 74  68 20 79 6f 75 72 0a 6f  |tion with your.o|
000001b0  77 6e 20 73 6f 66 74 77  61 72 65 20 70 61 63 6b  |wn software pack|
000001c0  61 67 65 73 2e 20 20 54  68 69 73 20 6d 65 61 6e  |ages.  This mean|
000001d0  73 20 74 68 61 74 20 79  6f 75 20 63 61 6e 0a 62  |s that you can.b|
000001e0  65 20 73 75 72 65 20 74  68 65 20 75 73 65 72 20  |e sure the user |
000001f0  6f 66 20 79 6f 75 72 20  73 6f 66 74 77 61 72 65  |of your software|
00000200  20 68 61 73 20 21 46 6f  6e 74 4d 47 52 32 2e 0a  | has !FontMGR2..|
00000210  0a 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.---------------|
00000220  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000240  2d 2d 2d 0a 0a 54 65 63  68 6e 69 63 61 6c 6c 79  |---..Technically|
00000250  2c 20 73 63 72 69 70 74  73 20 61 72 65 20 64 65  |, scripts are de|
00000260  6c 74 20 77 69 74 68 20  69 6e 20 74 68 65 20 66  |lt with in the f|
00000270  69 6c 65 0a 22 21 46 6f  6e 74 4d 47 52 32 22 2e  |ile."!FontMGR2".|
00000280  54 65 63 68 54 65 78 74  2e 53 63 72 69 70 74 73  |TechText.Scripts|
00000290  22 2c 20 62 75 74 20 49  20 77 6f 75 6c 64 20 6c  |", but I would l|
000002a0  69 6b 65 0a 74 6f 20 6e  6f 77 20 70 6f 69 6e 74  |ike.to now point|
000002b0  20 6f 75 74 20 68 6f 77  20 79 6f 75 20 6d 69 67  | out how you mig|
000002c0  68 74 20 75 73 65 20 74  68 65 20 73 63 72 69 70  |ht use the scrip|
000002d0  74 0a 74 6f 20 79 6f 75  72 20 61 70 70 6c 69 63  |t.to your applic|
000002e0  61 74 69 6f 6e 27 73 20  61 64 76 61 6e 74 61 67  |ation's advantag|
000002f0  65 2e 0a 0a 42 65 63 61  75 73 65 20 6d 6f 73 74  |e...Because most|
00000300  20 61 70 70 6c 69 63 61  74 69 6f 6e 73 20 73 65  | applications se|
00000310  65 6d 20 74 6f 20 63 68  65 63 6b 20 77 68 69 63  |em to check whic|
00000320  68 0a 66 6f 6e 74 73 20  61 72 65 20 61 76 6c 69  |h.fonts are avli|
00000330  61 62 6c 65 20 65 61 63  68 20 74 69 6d 65 20 74  |able each time t|
00000340  68 65 79 20 70 72 65 73  65 6e 74 20 74 68 65 0a  |hey present the.|
00000350  75 73 65 72 20 77 69 74  68 20 61 20 6d 65 6e 75  |user with a menu|
00000360  2c 20 61 6e 79 20 63 68  61 6e 67 65 73 20 6d 61  |, any changes ma|
00000370  64 65 20 77 69 74 68 20  21 46 6f 6e 74 4d 47 52  |de with !FontMGR|
00000380  32 0a 61 72 65 20 72 65  66 6c 65 63 74 65 64 20  |2.are reflected |
00000390  69 6e 20 74 68 65 20 61  70 70 6c 69 63 61 74 69  |in the applicati|
000003a0  6f 6e 27 73 20 6d 65 6e  75 2e 20 20 54 68 69 73  |on's menu.  This|
000003b0  0a 73 69 64 65 20 6f 66  20 74 68 69 6e 67 73 20  |.side of things |
000003c0  69 73 20 69 6e 20 65 73  73 65 6e 63 65 20 22 64  |is in essence "d|
000003d0  65 61 6c 74 20 77 69 74  68 22 2e 0a 0a 48 6f 77  |ealt with"...How|
000003e0  65 76 65 72 20 69 66 20  79 6f 75 72 20 61 70 70  |ever if your app|
000003f0  6c 69 63 61 74 69 6f 6e  20 69 73 20 67 69 76 65  |lication is give|
00000400  6e 20 61 20 66 69 6c 65  20 74 68 61 74 0a 6d 61  |n a file that.ma|
00000410  6b 65 73 20 75 73 65 20  6f 66 20 66 6f 6e 74 73  |kes use of fonts|
00000420  20 74 68 61 74 20 61 72  65 20 69 6e 20 70 61 73  | that are in pas|
00000430  73 69 76 65 20 67 72 6f  75 70 73 2c 0a 74 68 65  |sive groups,.the|
00000440  6e 20 74 68 6f 73 65 20  66 6f 6e 74 73 20 2a 41  |n those fonts *A|
00000450  52 45 2a 20 70 72 65 73  65 6e 74 2c 20 62 75 74  |RE* present, but|
00000460  20 61 72 65 20 6a 75 73  74 0a 68 69 64 65 65 6e  | are just.hideen|
00000470  20 66 72 6f 6d 20 79 6f  75 72 20 61 70 70 6c 69  | from your appli|
00000480  63 61 74 69 6f 6e 2e 20  20 57 68 61 74 20 49 20  |cation.  What I |
00000490  73 75 67 67 65 73 74 0a  79 6f 75 20 64 6f 2c 20  |suggest.you do, |
000004a0  69 73 20 74 6f 20 63 68  65 63 6b 20 69 66 20 21  |is to check if !|
000004b0  46 6f 6e 74 4d 47 52 32  20 69 73 20 72 75 6e 6e  |FontMGR2 is runn|
000004c0  69 6e 67 2e 0a 54 68 69  73 20 63 61 6e 20 62 65  |ing..This can be|
000004d0  20 64 6f 6e 65 20 65 61  73 69 6c 79 20 62 79 20  | done easily by |
000004e0  72 65 61 64 69 6e 67 20  69 6e 20 74 68 65 20 76  |reading in the v|
000004f0  61 6c 75 65 0a 6f 66 20  74 68 65 20 73 79 73 74  |alue.of the syst|
00000500  65 6d 20 76 61 72 69 61  62 6c 65 20 3c 46 24 52  |em variable <F$R|
00000510  75 6e 6e 69 6e 67 3e 2e  20 20 49 74 27 73 0a 76  |unning>.  It's.v|
00000520  61 6c 75 65 20 77 69 6c  6c 20 62 65 20 65 69 74  |alue will be eit|
00000530  68 65 72 20 22 54 52 55  45 22 20 6f 72 20 22 46  |her "TRUE" or "F|
00000540  41 4c 53 45 22 2e 20 20  49 66 20 69 74 27 73 0a  |ALSE".  If it's.|
00000550  22 54 52 55 45 22 20 74  68 65 6e 20 22 46 69 6c  |"TRUE" then "Fil|
00000560  65 72 5f 52 75 6e 22 20  61 20 73 63 72 69 70 74  |er_Run" a script|
00000570  20 66 69 6c 65 20 63 6f  6e 74 61 69 6e 69 6e 67  | file containing|
00000580  0a 61 20 22 66 6f 6e 74  20 68 75 6e 74 22 20 6f  |.a "font hunt" o|
00000590  66 20 74 68 65 20 66 6f  6e 74 73 20 79 6f 75 20  |f the fonts you |
000005a0  72 65 71 75 69 72 65 2e  20 20 49 66 0a 21 46 6f  |require.  If.!Fo|
000005b0  6e 74 4d 47 52 32 20 69  73 6e 27 74 20 72 75 6e  |ntMGR2 isn't run|
000005c0  6e 69 6e 67 20 74 68 65  6e 20 72 75 6e 20 74 68  |ning then run th|
000005d0  65 20 66 69 6c 65 20 77  69 74 68 69 6e 0a 74 68  |e file within.th|
000005e0  65 20 46 6f 6e 74 4d 47  52 32 20 72 65 73 6f 75  |e FontMGR2 resou|
000005f0  72 63 65 73 20 64 69 72  65 63 74 6f 72 79 20 65  |rces directory e|
00000600  6e 74 69 74 6c 65 64 2c  0a 22 42 6f 6f 74 46 6f  |ntitled,."BootFo|
00000610  6e 74 73 22 2e 20 20 49  74 27 73 20 73 79 6e 74  |nts".  It's synt|
00000620  61 78 20 69 73 3a 0a 0a  20 42 6f 6f 74 46 6f 6e  |ax is:.. BootFon|
00000630  74 73 20 3c 66 69 6c 65  6e 61 6d 65 3e 0a 0a 49  |ts <filename>..I|
00000640  66 20 74 68 65 20 66 69  6c 65 6e 61 6d 65 20 69  |f the filename i|
00000650  73 20 6f 6d 69 74 74 65  64 2c 20 69 74 20 77 69  |s omitted, it wi|
00000660  6c 6c 20 73 65 74 20 75  70 20 61 73 0a 64 65 66  |ll set up as.def|
00000670  61 75 6c 74 2e 20 20 42  6f 6f 74 46 6f 6e 74 73  |ault.  BootFonts|
00000680  20 77 69 6c 6c 20 61 63  63 65 70 74 20 66 6f 6e  | will accept fon|
00000690  74 20 68 75 6e 74 73 2e  0a 0a 49 66 20 74 68 65  |t hunts...If the|
000006a0  20 73 79 73 74 65 6d 20  76 61 72 69 61 62 6c 65  | system variable|
000006b0  20 22 3c 46 6f 6e 74 4d  47 52 32 24 44 69 72 3e  | "<FontMGR2$Dir>|
000006c0  22 20 69 73 20 6e 6f 74  0a 70 72 65 73 65 6e 74  |" is not.present|
000006d0  20 74 68 65 6e 20 6f 62  76 69 6f 75 73 6c 79 20  | then obviously |
000006e0  74 68 65 20 75 73 65 72  20 64 6f 65 73 6e 27 74  |the user doesn't|
000006f0  20 75 73 65 0a 21 46 6f  6e 74 4d 47 52 32 20 2d  | use.!FontMGR2 -|
00000700  20 73 69 6c 6c 79 2e 0a  0a 2d 2d 2d 2d 2d 2d 2d  | silly...-------|
00000710  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000730  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0a 0a           |-----------..|
0000073d