%Archive-Date: Fri, 04 Jun 1993 11:28:31 CST
%Sender: ITeX-Mgr@SHSU.edu
%From: tim@maths.tcd.ie (Timothy Murphy)
%Reply-To: tim@maths.tcd.ie (Timothy Murphy)
%Subject: The "accents" processor for making virtual fonts
%Date: Fri, 4 Jun 1993 15:34:22 GMT
%Keywords: TeX virtual fonts accents
%To: tex-news@SHSU.EDU

\documentstyle[a4,12pt]{article}

\catcode`\"=\active
\def"#1"{{\tt #1}}

\title{Making virtual fonts with Jir\'{\i} Zlatu\u{s}ka's `Accents' program}

\author{Timothy Murphy\\
School of Mathematics, Dublin, Ireland\\
\verb"<tim@maths.tcd.ie>"}

\date{1 June 1993}

\begin{document}

\maketitle

\section{What does the "accents" program do?}

The "accents" program by Jir\'{\i} Zlatu\u{s}ka
converts a traditional 128-character "tfm" file
(such as "cmr10.tfm")
into a 256-character virtual font, say "vcmr10.vf",
together with the associated "tfm" file "vcmr10.tfm".
This virtual font contains the original font
in the first 128 places,
and accented characters in some of the later places.
It can also contain other characters
defined in an auxiliary file.

Thus "accents" should allow existing \TeX\ fonts
to be converted easily to a form
similar to, and perhaps interchangeable with,
the new DC fonts.

\section{Why use extended fonts?}

The principal advantage of representing an accented character,
say `\'e', as a single character in a font---%
whether by DC fonts or virtual fonts---%
is that it greatly simplifies hyphenation.

It may also assist in the `alphabetical' ordering
of indexes and similar lists.

\section{Virtual fonts versus DC fonts}

A virtual font does not contain the actual bit-maps
of the glyphs;
rather, it points to fonts containing these bit-maps.
Thus the bit-maps for the virtual font "vcmr10"
would take approximately half the space
used by the corresponding DC font "dcr10".
(We are talking here of the "PK" fonts
used by the output driver.)

It should also be easier to modify the position of accents
in virtual fonts.
The program "vftovp" converts the font "x.vf"
to the text form "x.vp" in so-called "vpl" format.
This file is readily edited,
and can then be reconverted with "vptovf".

Against this, relatively few drivers
presently support virtual fonts.
(One that does is "dvips".)
Presumably this lack will be remedied
in the reasonably near future.

\section{A practical example}

We convert the "cmr10" font to virtual form
with the command
\begin{verbatim}
    accents cmr10.tfm vcmr10.vf vcmr10.tfm
\end{verbatim}
Or, if you want more information about what is going on,
\begin{verbatim}
    accents -verbose cmr10.tfm vcmr10.vf vcmr10.tfm
\end{verbatim}

Now put "vcmr10.vf" in the place where dvips expects to find it.
(On my system the current directory is specified in
both the "VFFONTS" and the "TEXFONTS" path-lists,
so there is nothing to do.)

As a test, give the command "tex testfont",
giving "vcmr10" as the font when requested:
\begin{verbatim}
    tex testfont
    Name of the font to test > vcmr10 scaled 1200
    *\table
    *quit
\end{verbatim}

Finally, run "testfont.dvi" through "dvips"
for a printed table of the extended font.
\begin{verbatim}
    dvips testfont
\end{verbatim}

\section{Compiling "accents" under Unix}

I retrieved Zlatu\u{s}ka's "accents.web" by anonymous FTP
from "ftp.tex.ac.uk" in the directory "pub/archive/support/accents".
So far as I am aware,
the only change file provided with the "accents" program
is Zlatu\u{s}ka's {\sc Pascal} change file "accents.chg",
intended for use with Turbo-Pascal.

However, most of the code in "accents.web"
is taken from the standard \TeX\ programs
"vftovp" and "vptovf".
(These are part of the standard \TeX\ distribution,
available eg from Karl Berry's archive
at "ftp.cs.umb.edu"
in the files "/pub/web.tar.z" and "/pub/web2c.tar.z".)

It is simple therefore to compile "accents"
as part of the UnixTeX system,
using "web2c" and the UnixTeX library.
I have written a "web2c" change file, "accents.ch",
for this purpose.
It may be found at "ftp.maths.tcd.ie"
as "pub/TeX/accents/accents.ch" or
"/src/TeX/web2c-5.851d/accents/accents.ch".

The "Makefile" in either directory
assumes that the "accents" directory is just below
the main \TeX\ software directory,
parallel to "web", "fontutil", etc.
But it is easy to see how to modify the Makefile
if this is not the case.

In principle you now say "make"
(in the "accents" subdirectory)
and the program should be compiled.

Note that the path-lists for "VFFONTS", etc,
where "accents" looks for virtual fonts,
are taken from the UnixTeX library "lib.a".
If you want to change these,
you should go back to the main TeX source directory,
modify the "Makefile"
(where these paths are specified in the most recent UnixTeX)
and recompile the library.

Or you can overrule these path-lists
by setting appropriate enviroment variables
(with "set" or "setenv").
For details see the "tex" manual entry.

\section{Compiling "accents" on the Macintosh}

I'm actually running "accents" on the Macintosh,
where it was compiled with "web2c" under Think C v5.
The application may be found at "ftp.maths.tcd.ie"
as "pub/Mac/TeX/accents.sit.hqx".

The UnixTeX change file "accents.ch" described above
is actually the change file for the Macintosh,
with irrelevant changes commented out.

\section{Zlatu\u{s}ka's coding}

Zlatu\u{s}ka outputs the "KOI8-CS" encoding
in this version of "accent";
but as he says, it is easy enough to change
the coding if desired.
I assume that the `Cork encoding' is now the \TeX\ standard,
but I am not an expert in \TeX\ coding theory.

Here is a part of the coding in "accents.web".
\begin{verbatim}
    dc8("A")(@'200)(breve_accent)(@'201)(ogonek)(@'300)(grave_accent)
    (@'301)(acute_accent)(@'302)(circumflex)(@'303)(tilde)
    (@'304)(umlaut)(@'305)(circle_accent)@/
    dc3("C")(@'202)(acute_accent)(@'203)(hachek)
    (@'307)(cedilla_accent)@/
\end{verbatim}
This means (I think!) that character with octal code 0200
is `A' with a breve-accent (whatever that is);
character 0201 is `A' with an ogonek,
character 0300 is `A' with a grave accent,
character 0301 is `A' with an acute accent,
and so on

It would of course be easy to modify this coding
through the change file.

Incidentally, we have been assuming so far that
the input file ("cmr10" in the example below)
follows the \TeX\ encoding.
But the program is equally well able to deal
with Adobe encoding
(which it recognises from the header)
and converting this into
a virtual font with \TeX\ encoding.

The input or output codings can also be specified
in the (optional) auxiliary file.

\end{document}

--
Timothy Murphy
e-mail: tim@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
