This directory contains encoding data for encodings that are not
hard-wired into the font backend code.  Currently, this is implemented
for the TrueType backend only.


1. Using encoding definition files

In order to use a font in an encoding that the font backend does not
know about, you need to have a `encodings.dir' file in the same
directory as the font file used.  `encodings.dir' has the same format
as `fonts.dir'.  Its first line specifies the number of encodings,
while every successive line has two columns, the name of the encoding,
and the name of the encoding file.  Every encoding name should
agree with the encoding name defined in the encoding file.  For
example,

  3
  mulearabic-0 mulearabic-0.enc
  mulearabic-1 mulearabic-1.enc
  mulearabic-2 mulearabic-2.enc

If your platform supports it, encoding files may be compressed or
gzipped.


2. Encoding file format

The encoding files are `free form', /i.e./ any string of whitespace is
equivalent to a single space.  They are not case sensitive, meaning
that `size', `SIZE', and `SiZE' all parse as the same keyword.

Numbers can be written in decimal, as in `256', in hexadecimal, as in
`0x100', or in octal, as in `0400'.

Comments are introduced by a hash sign `#'.  All characters following
the `#' are ignored, up to the next end of line.

The encoding file starts with the definition of the name of the
encoding:

  STARTENCODING mulearabic-0

The name of the encoding should be suitable for use in an XLFD font
name, and thus contain exactly one dash `-'.

It may then optionally declare the size of the encoding

  SIZE 0x2B

Codes equal or larger than the size are taken to be undefined.  The
size defaults to 256 (0x100).  This means that you must declare the
size of 16 bit encodings.

What follows is a mapping section.  Mapping sections start with a line
stating the target of the mapping, either ISO 10646 (Unicode)

  STARTMAPPING unicode

or a given TrueType `cmap':

  STARTMAPPING cmap 3 1

Every line in a mapping section maps one code

  0x21 0x0660
  0x22 0x0661
  ...

Codes not listed assumed to map through the identity (/i.e./ to the
same numerical value).  In order to override this default mapping, you
may specify a range of codes to be undefined by using an `UNDEFINE'
line:

  UNDEFINE 0x00 0x2A

This works because later values override earlier one.

A mapping section ends with an ENDMAPPING line

  ENDMAPPING

and the file ends with an ENDENCODING line

  ENDENCODING

In order to make future extensions to the format possible, lines
starting with an unknown keyword are ignored, as are mapping sections
with an unknown target.



                                        Juliusz Chroboczek
                                        <jec@dcs.ed.ac.uk>
