Skip to main content
? Red Sector

GRACIA FONT AND PROPRINT, A VALABLE ADDITION TO 1ST_WORD (PLUS)
by Ewalt Scherer

Ewalt Scherer, Koningslaan 2a, NL 1405 GL Bussum, The Netherlands

I had been asked recently by Richard to write something about the 
programs  I had written to allow scientific  wordprocessing  with 
1ST_word (PLUS),  and to make possible a perfect printout with 9-
9-needle  Epson-compatible  dot matrix  printers.  This  software 
package  became quite successful in The Netherlands.  I wrote  it 
primarily  for  my  own  needs  of  special  characters  in   the 
preparation   of  (scientific)   manuscripts.   Greek/mathematic, 
russian  and  classik greek/hebrew fonts are  available  at  this 
moment.  The high quality print - proportional pitch,  justified, 
several  fonts  of  224  characters  each  -  together  with  the 
possibility to print the WORDPLUS graphics,  make this program  a 
'must' for almost every ST user.

History

Some  years ago I had my first contact with computers as  a  CP/M 
system entered our laboratory to 'facilitate' the preparation  of 
scientific manuscripts.  This CP/M computer did not allow the use 
of greek characters,  or of super- and subscript as is  regularly 
needed in chemical formulas, denotation of radioactively labelled 
compounds etc.  My first steps in programming therefore became  a 
little  BIOS  patching,  the  incorporation of  a  small  printer 
conversion  table which translates the code sequence used in  the 
text  to  denote  a greek character into  the  code  telling  the 
Diabolo  daisy wheel printer to use the  alternative,  scientific 
character set.
On  the MS/DOS machines coming later,  scientific  wordprocessing 
(we use WORDMARK) remained a cryptic business.  Greek  characters 
were now available,  but they were scattered over the keyboard in 
such  a way that only a conversion table could tell were to  find 
them.

Scientific text with 1ST_WORD

Two years ago the ATARI ST came on the market.  A  Macintosh-like 
graphic  user interface,  a much better screen than on any  other 
affordable computer,  a fast processor ...  all that at a  really 
low price.  There was no software, however. We early ST fans were 
shown nice demo's of GEM Write,  and were promised that we  would 
get it soon...  It never came.  Instead of that,  however, we got 
1ST_WORD.  It looked quite nice - but was inacceptable again  for 
serious scientific work:  The nice super- and subscript style was 
lost during block operations, only some greek characters  (and of 
course not the necessary ones) were available in the Atari system 
font.
This  brought me back to programming again.  It should be  little 
work  to change the unused hebrew characters of the system  font, 
in  order  to make available all the greek  characters,  and  the 
super-  and subscript numbers.  The font alteration (in RAM)  was 
indeed easy, since the Atari font could be replaced by a modified 
version by simply copying it into the same RAM position. Entering 
these characters into a manuscript by clicking in the font window 
of 1ST_WORD was,  however, far from ideal yet. For occasional use 
this is acceptable;  for serious work,  however,  an  alternative 
keyboard definition was needed.

Accessory for alternative keyboard

The X-BIOS function 16,  Keytbl(unshift, shift, capslock), can be 
used to this end.  If it is called from a desk accessory, a small 
program  which runs behind the main program and watches the state 
of the mouse,  the keyboard and/or the timer,  we can switch  the 
keyboard  by  simply  pressing  a  key  combination.  Since  desk 
accessories  need  a special starting routine  (supplied  in  the 
Digital  Research  'C'  development  kit  as   accstart.o),   the 
accessory had to be written in 'C'.
Watching  the  occurrence  of a specified evert  is  done  in  an 
endless program loop (function multi() in listing 1),  by the AES 
function event_multi().  If an event - in our case a timer  event 
produced by  evnt_timer(50,0) - occurs, this function returns the 
state of mouse and keyboard.  In the variable kstate the state of 
the  special keys Control,  Shift,  Alternate,  Help and Undo  is 
returned  in form of a bit vector.  I have choosen for  the  left 
Shift and the Alternate keys to switch  keyboards.  Consequently, 
on  each timer event it is tested,  whether this key  combination 
had  been  pressed [ if ((kstate & KEY1) && (kstate &  KEY2)   in 
listing 1 ].  KEY1 and KEY2,  the bit masks for the desired  keys 
were  defined  earlier  as 2 and 8.  If the  keys  were  pressed, 
Norm_tabel() or Alt_table() are called,  depending on the present 
keyboard  definition,   in  order  set  the  keyboard  definition 
properly.

/*   Central routine in a desk accessory to watch,  and react  on 
*    the pressing of two specified special keys (left  shift  and 
*    alternate.
*    The necessary declarations,  and the function main() calling 
*    multi() are not shown.
*/
multi()
{
int event;
      while (TRUE) {                      /* run forever    */
        event = evnt_multi(MU_TIMER,    /* only timer event */
                  1,1,1,
                  0,0,0,0,0,
                  0,0,0,0,0,
                  msgbuff,0,0,&ret,&ret,&ret,
                  &kstate,&ret,&ret);    /* get keystate    */

 
       if (event & MU_TIMER) {          /* timer event ?   */
          if (!(repflag))                /* repflag = 0 ?   */  
          {              
               if ((kstate & KEY1) && (kstate & KEY2)) 
               {                         /* alt/re. shift ? */
                    if (altflag) {       /* alt. keyboard   */
                      normtabel();   /* set stand. keyboard */  
                      altflag = 0;
                      repflag = 10;  /* inactive 10 cycles  */
                    } else {             /* stand. keyboard */
                      alttabel();    /* set altern. Keyb.   */
                      altflag = 1;
                      repflag = 10;
                    }                      /* if (altflag)  */
               } 
          } else {
               repflag--;                                                       
          }                             /* if (!(repflag))  */                 
     }                                  /* if timer event   */                   
         evnt_timer(50,0);           /* produce timer event */
}                                          /* while (TRUE)  */

The  functions normtabel() and alttabel() make use of the  X-BIOS 
function  Keytbl()  to change the keyboard pointers  to  our  own 
standard or alternate keyboard tables.

normtabel()
{
    Keytbl(key_table+UNSHIFT,key_table+SHIFT,key_table+CAPSLOCK);
}

alttabel()     
{
    Keytbl(alt_table+UNSHIFT,alt_table+SHIFT,alt_table+CAPSLOCK);             
}

UNSHIFT,  SHIFT and CAPSLOCK are the offset values for the  begin 
of  the  unshift,  shift  or capslock part  of  the  standard  or 
alternate keytable.

The ROM operating system

The   coming  of  the  operating  system  in  ROM  made   further 
programming necessary. The system font could no longer be changed 
directly. Instead of, an appropriate pointer had to be set to our 
own  font tabel in RAM.  I could find such a pointer  only  after 
long searching. A good artikle published recently in the dutch ST 
magazine 'STart' (number 6/1987) had helped a lot - but I had  to 
solve this problem a good year earlier. I will tell about this in 
a future issue of ST NEWS.

Gracia FONT and PROPRINT

Let  me now add stil some notions about the present state of  the 
gracia package (as I called it).  The FONT accessory runs without 
problems since more than a year.  Problems to solve came from the 
site of  the designing and printing of the new characters.  About 
one   year  ago  GFA  Basic  arrived,   and  it  became   evident 
immediately,  that this structured language was suitable for  the 
progamming  of the parts still lacking of gracia:  the font-  and 
keyboard  editors,  a program to 'download' printfonts to a  dot-
matrix printer,  and as the last step in evolution - the  writing 
of  the  graphic print program PROPRINT.  Proprint can  load  one 
print  font for each of the style elements of  1ST_WORD(+);  that 
means that up to 7*224 characters can be defined,  making the use 
of  several specific fonts (f.i.  greek/mathematic  and  russian) 
possible.   Printing  can  be  with  variable  character  length, 
resulting in proportional,  justified NLQ text.  The NLQ  quality 
can  be  achieved with most  Epson-compatible  9-needle  printers 
which can move the paper in steps of 1/216 inch,  irrespective of 
the printers own NLQ capability (for example Epson RX-80). 

For those of you interested in using the gracia FONT and PROPRINT 
programs I want to add some information about how to get them:  I 
ask for the whole package, consisting of 2 single-sided diskettes 
with  either the greek/mathematic or the russian  FONT  accessory 
(please specify - for specialists an oldgreek/hebreuw version  is 
also  available),  PROPRINT  with 7  fonts,  font-  and  keyboard 
editors  and a manual (dutch,  german or english) 129.-  DM  (for 
PROPRINT only 89.- DM). You can order by sending an Eurocheck, or 
another check made payable on my name:  E.  Scherer,  Koningslaan 
2a, NL 1405 GL Bussum.

Editorial remark: A true review of the gracia package Mr. Scherer 
wrote about in this article was also meant to be published, but I 
think  this article suffices,  keeping in the back of  our  minds 
that we really had space problems with this issue (which actually 
resulted in an even smaller ST NEWS program as well as some  more 
crunching of the text files by putting them in one large file).

Disclaimer
The text of the articles is identical to the originals like they appeared in old ST NEWS issues. Please take into consideration that the author(s) was (were) a lot younger and less responsible back then. So bad jokes, bad English, youthful arrogance, insults, bravura, over-crediting and tastelessness should be taken with at least a grain of salt. Any contact and/or payment information, as well as deadlines/release dates of any kind should be regarded as outdated. Due to the fact that these pages are not actually contained in an Atari executable here, references to scroll texts, featured demo screens and hidden articles may also be irrelevant.