0. ABSTRACT

  This package is intended for Greek Linux users wishing to read and write
Greek in an easy, DOSsy way.

  Greek support does not include fonts for X, [La]TeX, or anything else,
apart from the text-based Linux console.


1. INCLUDED FILES

  This is a list of the included files:

INSTALL                 Tells you to run install.greek. :-)
README                  You're reading me already!
TEST.GREEK              Test file with 8-bit IBM ASCII characters & Greek.
console                 A Greek-aware terminfo entry.
console.source.grk      ... and its source.
grconv                  A tr-based filter to convert 8-bit & Greek to ASCII.
gren                    Script that enables Greek support for the console.
grdis                   Script that disables Greek support for the console.
greek.map               Greek keymap with a few extras.
greek11.lsm             Linux Software Map entry for this package.
grk8x11.fnt             A 437-based Greek 8x11 font.
grk8x8.fnt              Likewise, an 8x8 font.
grk9x14.fnt             9x14 Greek font.
grk9x16.fnt             9x16 Greek font.
grk9x16mdv.fnt          9x16 'Medieval' font with Greek characters.
install.greek           Run this one to install the package.
reset                   Modified version of reset(1).
termcap.gz              GZIPped Greek-aware termcap file.
trivial                 Trivial translation table, ideal for Greek chr sets!



2. WHAT TO DO

  OK... To make your system support Greek, you need to

(a). Load a Greek keymap file. This will enable you to switch from QWERTY to
     Greek keyboard (ELOT, I think) and vice versa. It also gives you some
     additional goodies about which we will talk later on.

(b). Make your system DISPLAY what you type, i.e. load the appropriate
     translation table.

(c). Load a Greek font so you can SEE what you type, as well.

(d). Make sure the above don't go away when the terminal is being reset.


2.1. THE GREEK KEYMAP (greek.map)

  Features:

  * Switch QWERTY<-->GREEK using a simple key combination (default: Alt-Enter)
  * Temporary switch while pressing AltGr key (right Alt key).
  * Full-featured standard US key map used as the normal mode of operation
  * ELOT-compliant Greek typewriter keymap (code page 437)
  * Capital & lower case Greek letters. 
  * Accents (tonoi) on lower case vowels.
  * Diaereses (dialytika) on lower case iota and upsilon.
  * Compose key combinations yielding frame drawing characters and graphics.


  The keymap starts in Latin mode, so you probably won't notice anything
unless you know what you're doing. :-)

  Pressing Alt-Enter (only the left Alt key works for that purpose) toggles
Greek mode. In Greek mode, everything except the alphabetic keys and the
semicolon-colon key works normally. The alphabetic keys, however, are remapped
like this:


Q       W       E       R       T       Y       U       I       O       P
*    sigma**  epsilon  rho     tau   upsilon  theta    iota  omicron   pi

  A       S       D       F       G       H       J       K       L       ;
alpha   sigma   delta    phi    gamma    eta     xi     kappa   lambda   ***

    Z       X       C       V       B       N       M
   zeta    chi     psi    omega   beta      nu      mu


*: This works just like the colon/semicolon key when in Greek mode
**: This is the version of sigma used to end words with.
***: Pressing this (semicolon) key will add an accent to the next lower case
     vowel key pressed. Typing a colon (shift+key) will add a diaeresis symbol
     to the next character, if possible. Upper case accented characters are
     not supported yet.

  
  Characters that can be accented are lower case alpha, epsilon, eta, iota,
omicron, upsilon and omega. Of them, only iota and upsilon may have a
diaeresis sign.


  You can temporarily switch to the Greek set by holding down the AltGr
(Right Alt key) while typing.

  The font you are using is assumed to be an ELOT-compliant Greek font
(based on the 437 code page, with the European special characters replaced
by the Greek alphabet). I am not certain whether ELOT dictates the use of
upper case accented vowels, but many of the Greek fonts and keyboard drivers
seem to ignore them, so I'll stick with lower case letters only.

  Another interesting feature of the keymap is its ability to allow the use
of the IBM extended ASCII graphics characters. Since Greek keyboards don't
use the compose key, we use it to form these characters. Unfortunately, on
the AT keyboard, AltGr was normally used as the Compose key. We're already
using AltGr as the Greek<->Latin switch, so we have to find some
alternatives:

  My keyboard has a 'Macro' key, with scan code 86. Messy-DOS sees it as a
second backslash key (since it's in the same place as the backslash key on UK
keyboards). I've mapped it to the Compose function.

  In case you don't have such a convenient dead key, I've also mapped the
Compose function to Ctrl-CapsLock.

  To output a graphics character, you work like this:

  To draw frame characters:

Compose + <setchar> + <diamond>, where

<setchar> = 'q' or 'a' (or upper case versions).
<diamond> = one of the following characters:       w   e   r         o = -
                                                    s   d   f   OR   p = |
                                                     x   c   v

Compose + 'q' + lower case diamond characters -> single frame characters
Compose + 'q' + upper case diamond characters -> double frame characters

Compose + 'a' + lower case diamond -> horizontal double, vertical single
Compose + 'a' + upper case diamond -> horizontal single, vertical double


  To draw other characters:

Compose + '1' = 25% grey block    ('')
Compose + '2' = 50% grey block    ('')
Compose + '3' = 75% grey block    ('')
Compose + '4' = solid block       ('')
Compose + '5' = bottom half block ('')
Compose + '6' = left half block   ('')
Compose + '7' = right half block  ('')
Compose + '8' = top half block    ('')
Compose + '9' = degrees           ('')
Compose + '-' = small dot         ('')
Compose + '=' = square root       ('')
Compose + '\' = small box         ('') 


2.2. TRANSLATION TABLES

  Normally, all you'd need would be this keymap file. Unfortunately, the
Linux console driver contains four character translation tables. The default
one, LATIN-1 (ISO-8859-1) does some funny character translations for ASCII
characters > 128 and so you won't be able to see anything in Greek.
 
  To fix this, a simple character map table is provided. This character map
is loaded into the user translation table of the console driver. This doesn't
require a kernel recompilation or anything as guru-like as that, but you'll
probably have to reload the table every time you do a console reset (<esc>c),
as well as at boot time. (See 2.3 for possible ways to patch this up)

  I've included a translation table (aka character map table, or whatever) by
the name of trivial, which leaves all the >128 'ASCII' codes
unchanged. Actually, this file was in my Slackware distribution
(/usr/lib/kbd/consoletrans/trivial). It did have a small problem, though,
which I've corrected (char 0x9b was mapped to 0x9f by mistake).

  There is also a shell script called gren (Greek enable), which loads the
9x16 Greek font, the Greek keymap, and switches all consoles to the user
translation table:

                #!/bin/sh

                setfont /usr/lib/kbd/consolefonts/grk9x16.fnt
                mapscrn /usr/lib/kbd/consoletrans/trivial
                loadkeys /usr/lib/kbd/keytables/greek.map
                for TTY in /dev/tty[0-9]*; do
                        echo -en "\033(K\033)K" >$TTY
                done

  Another shell script, grdis (Greek disable), negates the effects of gren,
and forces the system back to the LATIN-1 character set, with a default 437
font and a US keyboard map.


2.3. GREEK FONTS

  The most commonly used type of Greek font is a hack of the 437 code page,
with Greek characters instead of European special characters. This font is
used by machines running DOS. Windows uses the 928 code page, which (of
course) is incompatible with the above '437'. I hear there is a proper Greek
code page nowadays (so it's no longer just an ex-437 :-) ), but don't quote
me on that. Here are the upper 128 characters of the Greek character set
(characters below 127 are standard ASCII):

        8       9       A       B       C       D       E       F
0       ALPHA   RHO     iota    *       *       *      omega    OMEGA'
1       BETA    SIGMA   kappa   *       *       *      alpha'   *
2       GAMMA   TAU     lambda  *       *       *      epsilon' *
3       DELTA   UPSILON mu      *       *       *      eta'     *
4       EPSILON PHI     nu      *       *       *      iota"    *
5       ZETA    CHI     xi      *       *       *      iota'    *
6       ETA     PSI     omicron *       *       *      omicron' *
7       THETA   OMEGA   pi      *       *       *      upsilon' *
8       IOTA    alpha   rho     *       *       *      upsilon" *
9       KAPPA   beta    sigma   *       *       *      omega'   *
A       LAMBDA  gamma   sigma2  *       *       *      ALPHA'   *
B       MU      delta   tau     *       *       *      EPSILON' *
C       NU      epsilon upsilon *       *       *      ETA'     *
D       XI      zeta    phi     *       *       *      IOTA'    *
E       OMICRON eta     chi     *       *       *      OMICRON' *
F       PI      theta   psi     *       *       *      UPSILON' *

legend:
        Capital letters are ALPHA, BETA, etc.
        Lower case letters are signified by alpha, beta, etc.
        sigma2: The version of sigma used to end words with.
        alpha', eta', etc: Accented vowels.
        iota",upsilon": Vowels with diaeresis sign.
        The capital accented vowels (EA to F0) are not supported by all
           fonts -- this package offers no support for them as of yet.


2.4. MAKING IT STAY

  To make Greek support stay on, we have to do the following.

  * Change /etc/termcap so, when the console is reset, the Greek translation
      table doesn't get destroyed. To do this, we change the rs= directive in
      /etc/termcap to switch the "user-defined translation table" back on. We
      do not change the rs1=, rs2=, and rs3= directives, because there are
      cases when we want to REALLY reset the tty (for example, when running
      grdis). A patched termcap is supplied in this package.

  * Change /usr/lib/terminfo in a similar fashion, so that [n]curses
      applications will behave when running with Greek support enabled. In
      addition to the reset string in terminfo, we need to patch up the
      directives which enable and disable the 'alternate character set'
      (i.e. the VT-100 graphics translation table), so that when we go back to
      the 'normal' character set, Greek support is re-enabled. A patched
      console entry for the terminfo database is included in this package.

  * As a final touch of paranoia, you can change your shell prompt to print
      the following string in addition to everything else:

                                <ESC>(K<ESC>)K

      A suitable command for bash would be as follows:

              export PS1='`echo -e "\033(K\033)K"` blah blah > '

     (or if your editor supports quoting characters, you can skip the 'echo'
     bit and put the ESC directives directly into the prompt string).

     One additional advantage of this technique is that with this prompt,
     CAT'ing binary files on your screen will not foul up the console
     display.


3. INSTALLING

  To install Greek support, run the script install.greek and follow
instructions. The following actions will be taken:

* The fonts will be copied to /usr/lib/kbd/consolefonts
* The Greek translation table will be put in /usr/lib/kbd/consoletrans
* The Greek keymap will go into /usr/lib/kbd/keytables
* gren, grdis, a modified reset(1) which will REMOVE Greek support, and
        grconv (a filter which translates 8-bit graphics characters and
        Greek letters to their obscure ASCII equivalents), get copied to
        /usr/bin. Any old versions of these four scripts are stored in /tmp.
* /etc/rc.d/rc.local is modified to run gren at boot time (optional).
* Install the patched termcap file (optional, see 2.4 for details).
* Install the patched terminfo entry (optional, see 2.4 for details).


4. TESTING AND 8-BIT FRIENDLY APPLICATIONS

  After installation, the install script will run gren, and test the results
by displaying the file TEST.GREEK.

  Now try this:

# cat

  Press Alt-Enter, and type something silly, like 'asd'. If everything is
OK, you should get an alpha, a sigma, and a delta. Otherwise, oops. :-)

  Remember that not everything running under Unix is 8-bit friendly. Try
something which you know will accept 8-bit ASCII, like minicom with the -l
flag.

  I've included a file TEST.GREEK with some Greek in it, for testing
purposes. It also contains other 8-bit ASCII characters like frames.


5. CONTACTING THE AUTHOR

  Bug reports, hate mail, and other stuff go to

  alexios@vennea.demon.co.uk, 
  axc@dcs.ed.ac.uk, or
  alexiosc@aisb.ed.ac.uk   (this .forwards everything to axc@dcs.ed.ac.uk)

  If you don't get any answers within a few days, chances are it's either
Christmas, Easter, or Summertime, so I'm on holiday. I'd hate to lose all that 
hate mail, though, so try this one: :-)

  morgul@acrogate.ath.forthnet.gr


Regards,                    ,888888.                             ,888888.
Alexios Chouchoulas       ,88'    `88.                         .88'    `88.
                         ,8'                                             `8.
                         8'                                               `8
                         "                                                 "
o88 ,o8888o. ,o8888oo.  o88o.  o888o.  .o88o.  .o88o. .88o .8888888o.     ,88
"88o88'  `88.88'   `88.88'`88.88' `88 o88'    o88'    88"  88'   `"888888888'
 88'      `88o      88o "" `88.' ,88' 888'    888'   .88      ,88888"'
 88      .o88'    .o88'     `88 ,88'  "88o.  o888o. o888    ,888'
o888888888888888888888o.     `8888'     `8888' `8888' 88   ,888'
 ""                           :88'                    88   888'
                             ,88'                     88   888             
                            ,88'.                     88.  888.           o88
                            88' 88                    88o  `888.         ,888
                            `8888'                    `88o   `8888.     ,888'
                                                        "      `"888888888'
