
% use (cs)plain

\input epsf

\newcount\firstpage   \firstpage=1
\newcount\numpages    \numpages=14

\def\,{\thinspace}

\input ofs [ffonts] \loadingenc=1    % Charter je ve skupin� free fonts

\setfonts [Charter/10pt]             % v�choz� rodina
\setmath[//]                         % inicializace matematiky
\fontdef\tt [CMTypewriter/mag1.1]    % strojopis, korekce st�edn� v��ky
\fontdef\verbtt [CMTypewriter-rm/8]  % strojopis pro display uk�zky
\fontdef\small [!/9]                 % zmen�en� pro abstrakt a z�hlav�
\addcmd \small {\baselineskip11pt \rm \def\mathversion{normal}\setmath[//]}
\fontdef\fontsekce [!/12]            % pro nadpisy sekc�
\addcmd \fontsekce {\bf \let\it=\bi \def\mathversion{bold}\setmath[//]} 
\fontdef\fonttitul [!-bf/14.4]       % titul
\fontdef\itnormal [!-it/10]

\hsize=12,2cm
\vsize=19,3cm
\hoffset=63pt
\voffset=43pt
\parindent=14pt

\lineskiplimit=-10pt
\raggedbottom

\exhyphenpenalty=10000
\widowpenalty=10000
\clubpenalty=10000

\showboxdepth=10 \showboxbreadth=50

\def\starthead{\global\headline=
     {\small \ifodd\pageno \hfil \thetitul \headspace \the\pageno 
     \else \the\pageno \headspace \theauthor \hfil \fi}}
\headline={\hfil\starthead}
\def\headspace{\hskip2.5em\relax}
\def\makeheadline{\vbox to0pt{\vskip-25pt
  \line{\vbox to8.5pt{}\the\headline}\vss}\nointerlineskip}
\footline={\setfonts[/7]\setmath[//]\baselineskip=9pt
     \vbox{\hbox{\copytext}\hbox{\copykonvoj}}\hfil
     \global\footline={}}
\def\lastpage{\advance\firstpage by\numpages \advance\firstpage by-1
     \the\firstpage}

\def\copytext{Bacho\TeX{} 2006}
\def\copykonvoj{}

\newcount\subnum

\def\etc{etc\spacefactor=999\relax}
\def\strut{}

\def\kap #1\par{\advance\subnum by1
   \removelastskip %\goodbreak
   \vskip17pt plus2pt minus1pt\noindent{\fontsekce
   \ifnum\subnum>1 \the\subnum\enspace\enspace\fi #1}%
   \par\nobreak\vskip11pt plus2pt minus1pt 
   \everypar{\setbox0=\lastbox \everypar={}}}
\def\reference {\subnum=-1 \kap References\par \small}
\def\bib{\par\advance\subnum by1 \leftskip=\parindent 
   \noindent\llap{\the\subnum.\enspace}\ignorespaces}

\let\orifootnote=\footnote
\newcount\footnotenum
\def\footnote#1{\global\advance\footnotenum by1
   \orifootnote{$\setmath[//]^\the\footnotenum$}{\small 
        \hangindent=\parindent #1\par}}
\def\footnoterule{\kern-3pt \hrule width 2cm \kern2.6pt }

\def\titul #1 \par{\def\thetitul{#1}\pageno=\firstpage
   \centerline{\fonttitul #1}\vskip20pt\relax}
\def\autor #1 \par{\def\theauthor{#1}
   \centerline{#1}\vskip10pt\relax}
\def\institut #1 \par{\centerline{\small #1}}
\def\email #1 \par{\centerline{\small Email: \tt #1}\vskip20pt\relax}
\def\abstrakt {\bgroup \small
   \leftskip=3em \rightskip=3em
   \noindent{\bf Abstract:}\enspace}
\def\endabstrakt {\par\egroup\bigskip}
\def\url#1{{\tt#1}}

\def\begitems{\medskip\bgroup\catcode`\*=13 \narrower}
\def\enditems{\par\egroup\medskip}
{\catcode`\*=13 \gdef*{\par\noindent\llap{$\bullet$\kern.6em }\ignorespaces}
\gdef\numerate{%                         \numerate napsat t�sn� za \begitems
  \def*{\par\advance\itemnum by1\noindent
    \llap{\bf\the\itemnum.\kern.6em }\ignorespaces}}}


\font\mflogo=logo10                       % METAFONT logo
\font\boldsy=cmbsy10 at12pt               % Tu�n� \CS, \AMS.
\font\bboldsy=cmbsy10 scaled\magstep2     % Tu�n� \CS v titulu

\def\CS{$\cal C\kern-.1667em\lower.5ex\hbox{$\cal S$}\kern-.075em $}
\def\bCS{{\boldsy C\kern-.1667em\lower.5ex\hbox{S}\kern-.04em}}
\def\CSTeX{\CS\TeX}
\def\CSTUG{\CS TUG}
\def\CSfont{\CS\kern.1em font}
\def\csplain{\CS\kern.1em plain} \let\CSplain=\csplain
\def\mf{{\mflogo META}\-{\mflogo FONT}}
\def\mp{{\mflogo META}\-{\mflogo POST}}
\def\LaTeX{L\kern-.2em\raise.45ex\hbox{\setfonts[/mag.7] A}\kern-.05em\TeX}
\def\twoe{$2_{\textstyle\varepsilon}$}
\def\LaTeXe{\LaTeX\thinspace\twoe}
\def\cslatex{\CS\kern.05em\LaTeX} \let\CSLaTeX=\cslatex
\def\twoe{$2_{\textstyle\varepsilon}$}
\def\LaTeXe{\LaTeX\thinspace\twoe}
\def\AMS{$\cal A\kern-.166em\lower.5ex\hbox{$\cal M$}\kern-.075em S$}
\def\bAMS{{\boldsy A\kern-.166em\lower.5ex\hbox{M}\kern-.075em S}}
\def\ps{Post\-Script}
\def\SLT{S\kern-0.025em\lower.5ex\hbox{L}\kern-.2emT}
\def\DOS{\hbox{DOS}}

%% Definice verbatim prost�ed� %%          !verb.
\catcode`\"=13
\def"{\hbox\bgroup\let"=\egroup\setverb\tt}
\def\setverb{\def\do##1{\catcode`##1=12}\dospecials\obeyspaces}
\def\begtt{\medskip\bgroup
   \nobreak\setverb \parskip=0pt %\parindent=0pt
   \catcode`\"=12\catcode`\~=13\catcode`\@=0\catcode`\<=12
   \def\par##1{\endgraf\ifx##1\par\leavevmode\fi##1}\obeylines
   \baselineskip=10pt
   \let\tt=\verbtt \startverb}
{\catcode`\|=0 \catcode`\\=12
  |gdef|startverb#1\endtt{%
        |tt#1|nobreak|egroup|penalty0|medskip|scannexttoken}}
{\obeyspaces\gdef {\ }}
\long\def\scannexttoken#1{\ifx#1\par\else\noindent#1\fi}

\def\=#1={\raise-3.4pt\vbox{%
   \hrule\hbox{\vrule height7pt depth3pt\kern1pt#1\kern1pt\vrule}\hrule}}
\def\enter{$_\leftarrow$\kern-.15em\raise.42em\hbox{$_{_|}$}}

\def\citeref #1 #2 {\expandafter\def\csname cit:#1\endcsname{#2}}
\citeref ofsftp      1
\citeref wwwstorm    2
\citeref slido       3
\citeref ofsdoc      4
\citeref ofs2003     5
\citeref stormcl     6
\citeref berry       7
\def\cite#1{[\ncite{#1}]}
\def\ncite#1{\expandafter\ifx \csname cit:#1\endcsname\relax
   \message{Warning: cite{#1} is not defined}??%
   \else \csname cit:#1\endcsname\fi}

\catcode`\<=\active  \def<#1>{{$\langle$\itnormal#1\/$\rangle$}}

%-------------------------------------------------------------------------

\titul  OFS -- Macro Package To Manage Your Fonts
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\autor Petr Ol\v s\'ak

\institut Faculty of Electrical Engineering, CTU, Prague

\email petr@olsak.net

\abstrakt 

OFS (Olsak's Font System) gives you a possibility to keep track of
your fonts; especially if you have many fonts. It provides tools for
making font catalogues, a comfortable user environment for font selection
etc. The OFS was presented in EuroTeX 2003
(Brest, France) \cite{ofs2003} but many new features was 
implemented in 2004. This
article presents the latest version of this package.
OFS is freely available on \cite{ofsftp}.

\endabstrakt


\kap What fonts are installed?

Interactive typesetting systems have one advantage: there is a
simple answer to the question cited in title of this section. Everybody
can call up a menu of such an interactive system and pick the item 
``fonts'' (or something similar), click the mouse and he/she
can see names of all available fonts. If the system is more powerful
then samples of fonts are listed, too. The user can simply choose any
font from this listing for his/her document: just click the mouse...

On the other hand, a \TeX{} user has a more problematic
situation. Imagine that you are sitting in front of a (somebody else's)
computer where \TeX{} is installed and you have to make a simple
poster with some attractive typeface. Your first question is: what
fonts are available? You can do ``"kpsewhich cmr10.tfm"'' to find the font
path, then you can ``"cd"'' to font path and ``"ls"'' font metric
files. Definitely, this is not a good idea...

On the other hand, if the OFS is correctly installed on the \TeX{}
system, then you can type the following (the user input is marked by rectangles):

\begtt
$ @=tex osftest=
This is TeX, Version 3.14159 (Web2C 7.3.7x)
encTeX v. Jun. 2004, the reencoding enabled.
(/usr/TeX/texmf/tex/ofs/ofstest.tex (/usr/TeX/texmf/tex/ofs/ofs.tex
OFS (Olsak's Font System) based on plain initialized. <Jul 2004>
(/usr/TeX/texmf/tex/ofs/ofsdef.tex)) (/usr/TeX/texmf/tex/ofs/ofs-8t.tex)
(/usr/TeX/texmf/tex/ofs/ofs-8c.tex))
*
This is ofstest macro, version <May 2004>
*** Type declaration file name (allfonts for example): @=allfonts=
(/usr/TeX/texmf/tex/ofs/allfonts.tex (/usr/TeX/texmf/tex/ofs/a117.tex
(/usr/TeX/texmf/tex/ofs/a35.tex)) (/usr/TeX/texmf/tex/ofs/ffonts.tex)
...
(/usr/TeX/texmf/tex/ofs/storm/slido.tex))
(/usr/TeX/texmf/tex/ofs/pantyk.tex))

*** Type family name without brackets (or ? or *): @=@enter=
OFS (l.0): The list of known font families (encoding 8t):
defaults:
   [CMRoman/]            \rm, \bf, \it, \bi, \sl, \bxsl
   [CMSans/]             \rm, \bf, \it, \bi
   [CMTypewriter/]       \rm, \bf, \it, \bi, \sl
   [Times/]              \rm, \bf, \it, \bi
   [Helvetica/]          \rm, \bf, \it, \bi, \nrm, \nbf, \nit, \nbi
   [Courier/]            \rm, \bf, \it, \bi
a35.tex:
   [AvantGarde/]         \rm, \bf, \it, \bi
   [Bookman/]            \rm, \bf, \it, \bi
   [NewCentury/]         \rm, \bf, \it, \bi
   [Palatino/]           \rm, \bf, \it, \bi
   [ZapfChancery/]       \rm,  - , \it,  - 
   [ZapfDingbats/]       \rm,  - ,  - ,  - 
   [Symbol/]             \rm,  - , \it,  - 
...
   [Evil/]               \rm,  - ,  - ,  - 
   [Ozdoby/]             \rm,  - ,  - ,  - 
   [Modell/]             \rm,  - , \it,  - , \env
   [Kompressor/]         \rm,  - , \it,  - , \ext, \exti
   [Libcziowes/]         \rm,  - ,  - ,  - 
   [Ohrada/]             \rm,  - ,  - ,  - 
   [Patzcuaro/]          \rm,  - ,  - ,  - 
   [Plagwitz/]           \rm,  - ,  - ,  - 
slido.tex:
   [Lido/]               \rm, \bf, \it, \bi, \crm, \cbf
pantyk.tex:
   [AntykwaTorunska/]    \rm, \bf, \it, \bi, \lr, \li, \mr, \mi
   [AntykwaTorunskaCaps/] \rm, \bf, \it, \bi, \lr, \li, \mr, \mi
   [AntykwaTorunskaCond/] \rm, \bf, \it, \bi, \lr, \li, \mr, \mi
   [Antykwatorunskacondcaps/] \rm, \bf, \it, \bi, \lr, \li, \mr, \mi
   [AntykwaPoltawskiego/] \rm, \bf, \it, \bi
 ... you can read more declaration files by \decl

*** Type family name without brackets (or ? or *): @=AntykwaTorunska=

*** What to do with family AntykwaTorunska ?
    (type command or \help): @=\list=

 [AntykwaTorunska/at10pt], encoding: 8t, variants:
   \rm (Regular)    cork-anttr at10pt + exp-anttr at10pt
   \bf (Bold)    cork-anttb at10pt + exp-anttb at10pt
   \it (Italic)    cork-anttri at10pt + exp-anttri at10pt
   \bi (BoldItalic)    cork-anttbi at10pt + exp-anttbi at10pt
   \lr (Light)    cork-anttl at10pt + exp-anttl at10pt
   \li (LightItalic)    cork-anttli at10pt + exp-anttli at10pt
   \mr (Medium)    cork-anttm at10pt + exp-anttm at10pt
   \mi (MediumItalic)    cork-anttmi at10pt + exp-anttmi at10pt
   Registered font encodings: 8t, 8z, 7k, 6w, 8a. Extra: 8x.
   Modifications: { 8z:antt }
\endtt

All fonts installed on your \TeX{} system are listed here.
You can use the "ofstest" macro as an interactive tool to print more
information about available fonts. The listing prints the long {\it human
readable\/} font family names and the variant switches "\rm", "\bf",
"\it", "\bi", \etc. available for each font family. You can write one
font family name on the prompt, the "\list" command then prints
more information about it: long names for all variant switches, the metric names (these are
usually cryptic names), encodings available for this family etc.

Fonts have typically more than 256 glyphs. This is a reason why OFS
records two metric filenames for such fonts: basic metric and extra metric
(see "exp-anttr" metric file listed in our example). 
OFS handles these couples of metric files as a single one. We'll
return to this problem later in section~6.


\kap Interactive macro "ofstest.tex"

I'll present a supplementary macro "ofstest.tex" first, not the "ofs.tex"
macro itself. I hope it would be no problem for reader.

All fonts are collected in packages of fonts. Each package can consist
of one or more font families and each font family has one or more font
variants. The "allfonts.tex" file has to be managed on \TeX{}
systems in order to keep track of all font packages actually installed.
These font packages are saved in "allfonts.tex" in a simple way:

\begtt
$ cat `kpsewhich allfonts.tex`
%%% All font packages installed on your TeX system
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\input a35        % adobe 35 base font collection (PS level2)
\input a117       % adobe 117 base font collection (PS level3)
\input ffonts     % free fonts (Charter etc.)
\input btfonts    % fonts from BitStream
\input skatalog   % fonts from Storm Type Foundry, typocatalog 3
\input pantyk     % Polish Antykwa
\endtt

Some packages can have sub-packages. For example the "skatalog" package includes
"slido", "stitul", "sjannon", "styfa", "sdynamo", etc.%
\footnote{The {\tt skatalog} package includes all fonts from 
          Typocatalog~3 by Storm Type 
          Foundry, see~[\ncite{wwwstorm}, \ncite{slido}].}
%
All these packages or sub-packages are implemented by {\it declaration
files} ("a35.tex", "ffonts.tex", "slido.tex" etc.). 
Long names of font families are declared here. A user can work only with one
or more declaration files, not (directly) with all fonts. 
In the following example, we
turn attention to "ffonts.tex" declaration file, namely the
Charter font family. 

\begtt
$ @=csplain ofstest "[ffonts]"=
This is TeX, Version 3.14159 (Web2C 7.3.7x)
encTeX v. Feb. 2003, the reencoding enabled.
(/usr/TeX/texmf/tex/ofs/ofstest.tex The format: csplain <Feb. 2000>.
The cs-fonts are preloaded and A4 size implicitly defined.
(/usr/TeX/texmf/tex/ofs/ofs.tex
OFS (Olsak's Font System) based on plain initialized. <May 2004>
(/usr/TeX/texmf/tex/ofs/ofsdef.tex)))
Czech hyphenation used (\language=5). \frenchspacing is set on.
(/usr/TeX/texmf/tex/ofs/ffonts.tex) This is ofstest macro, version <May 2004>

*** Type family name without brackets (or ? or *): @=Charter=

*** What to do with family Charter ?
    (type command or \help): @=\help=
commands:
 \list ..... List all variants of the family Charter
 \table(s) . Tables of all variants of the family Charter
 \abet ..... One line alphabet/digits sample for each variant
 \chars .... Print list of available characters including TeX sequences
 \text ..... One paragraph in all variants of the family Charter
 \mixed .... Paragraph with fonts combined from \rm, \bf, \it and \bi
 \math ..... Mathematics text combined by fonts from Charter
 \all ...... The same as \list \table \abet \chars \text \mixed \math 
 \setsize .. Set size of fonts (current size is "at10pt")
 \cfam ..... Change current family
 FamName ... The same as \cfam FamName
 \rem ...... Remove current family or family given in parameter from \famlist
 -----------------------------
 \famlist .. Show list of all declared families (the same as \showfonts)
 \decl ..... Input next declaration file
 \remdecl .. Remove all families of given declaration file from famlist
 \help ..... This text
 \morehelp . Show more help information
 \fontusage  The help screen of the OFS
 \end ...... End of this session 

*** What to do with family Charter ?
    (type command or \help): @=\abet \chars \mixed \math \end=

 [Charter/at10pt]: \rm abet (/usr/TeX/texmf/tex/ofs/ffonts.tex) \bf abet
\it abet \bi abet 
 [Charter/]: \chars (/usr/TeX/texmf/tex/ofs/ofs-8z.tex) 
 [Charter/at10pt]: mixed text (/usr/TeX/texmf/tex/ofs/ofs-ps.tex) 
 [Charter/at10pt] (\fomenc: PS) [10.0pt/7.0pt/5.0pt]: math text
[1]
Output written on ofstest.dvi (1 page, 7492 bytes).
Transcript written on ofstest.log.
\endtt

The "csplain" is a Czech alternative to plain\TeX{}. This format is used
in this example because I prefer to have "8z" (Czech encoding) as default and
the samples will be printed in Czech language (on the other hand, if
"tex" command is used, the English samples are printed and "8t"
encoding is used).

The "\help" command gives a self-explanatory result. In the example above, we
printed short lines with font samples, a list of all \TeX{} sequences to
access the glyphs of the tested font, more interesting samples which mix
the normal variant of the tested font with bold or italic and a complex
math typesetting sample of the tested font. The result 
(viewed by "xdvi ofstest") 
is shown in picture 1. Note that the dimensions mentioned on margins are not
true because the picture is scaled down in this article.

\topinsert
\epsfxsize=\hsize \epsfbox{charter.eps}
\medskip
\centerline{Picture 1. A test of Charter font family}
\medskip\hrule \vskip-5pt
\endinsert

Now we'll initialize "ofstest" without any declaration file:

\begtt
$ @=csplain ofstest=
This is TeX, Version 3.14159 (Web2C 7.3.7x)
...
This is ofstest macro, version <May 2004>

*** Type declaration file name (allfonts for example): @=@enter=
(/usr/TeX/texmf/tex/latex/tools/.tex File ignored)

*** Type family name without brackets (or ? or *): @=@enter=
OFS (l.0): The list of known font families (encoding 8z):
defaults:
   [CMRoman/]            \rm, \bf, \it, \bi, \sl, \bxsl
   [CMSans/]             \rm, \bf, \it, \bi
   [CMTypewriter/]       \rm, \bf, \it, \bi, \sl
   [Times/]              \rm, \bf, \it, \bi
   [Helvetica/]          \rm, \bf, \it, \bi, \nrm, \nbf, \nit, \nbi
   [Courier/]            \rm, \bf, \it, \bi
 ... you can read more declaration files by \decl

*** Type family name without brackets (or ? or *): @=CMRoman=

*** What to do with family CMRoman ?
    (type command or \help): @=\list=

 [CMRoman/at10pt], encoding: 8z, variants:
   \rm ()    csr10 at10pt + tcrm1000 at10pt
   \bf (Bold)    csbx10 at10pt + tcbx1000 at10pt
   \it (Italic)    csti10 at10pt + tcti1000 at10pt
   \bi (BoldItalic)    csbxti10 at10pt + tcbi1000 at10pt
   \sl (Slanted)    cssl10 at10pt + tcsl1000 at10pt
   \bxsl (BoldSlanted)    csbxsl10 at10pt + tcbl1000 at10pt
   Registered font encodings: 8z, 8t, 6a. Extra: 8c.
   Modifications: { 8z:csfont }

*** What to do with family CMRoman ?
(type command or \help): @=\setsize 12pt=

*** What to do with family CMRoman ?
    (type command or \help): @=\list=

 [CMRoman/at12pt], encoding: 8z, variants:
   \rm ()    csr12 at12pt + tcrm1200 at12pt
   \bf (Bold)    csbx12 at12pt + tcbx1200 at12pt
   \it (Italic)    csti12 at12pt + tcti1200 at12pt
   \bi (BoldItalic)    csbxti12 at12pt + tcbi1200 at12pt
   \sl (Slanted)    cssl12 at12pt + tcsl1200 at12pt
   \bxsl (BoldSlanted)    csbxsl10 at12pt + tcbl1200 at12pt
   Registered font encodings: 8z, 8t, 6a. Extra: 8c.
   Modifications: { 8z:csfont }

*** What to do with family CMRoman ?
    (type command or \help): @=\def\fotenc{8t}\list=

 [CMRoman/at12pt], encoding: 8t, variants: (/usr/TeX/texmf/tex/ofs/ofs-8t.tex)
   \rm ()    ecrm1200 at12pt + tcrm1200 at12pt
   \bf (Bold)    ecbx1200 at12pt + tcbx1200 at12pt
   \it (Italic)    ecti1200 at12pt + tcti1200 at12pt
   \bi (BoldItalic)    ecbi1200 at12pt + tcbi1200 at12pt
   \sl (Slanted)    ecsl1200 at12pt + tcsl1200 at12pt
   \bxsl (BoldSlanted)    ecbl1200 at12pt + tcbl1200 at12pt
   Registered font encodings: 8z, 8t, 6a. Extra: 8c.
   Modifications: { 8z:csfont }

*** What to do with family CMRoman ?
    (type command or \help): @=\def\fotenc{6a}\list=

 [CMRoman/at12pt], encoding: 6a, variants: (/usr/TeX/texmf/tex/ofs/ofs-6a.tex)
   \rm ()    larm1200 at12pt + tcrm1200 at12pt
   \bf (Bold)    labx1200 at12pt + tcbx1200 at12pt
   \it (Italic)    lati1200 at12pt + tcti1200 at12pt
   \bi (BoldItalic)    labi1200 at12pt + tcbi1200 at12pt
   \sl (Slanted)    lasl1200 at12pt + tcsl1200 at12pt
   \bxsl (BoldSlanted)    labl1200 at12pt + tcbl1200 at12pt
   Registered font encodings: 8z, 8t, 6a. Extra: 8c.
   Modifications: { 8z:csfont }
\endtt

You can see that OFS loads six font families as default. We have
chosen CMRoman family and printed more information about it
by "\list" command.
If Czech "8z" encoding is used then Computer Modern Roman family is
realized by CSfonts (metric "csr10.tfm" etc.). Next, we have changed 
the font size from default 10\,pt to 12\,pt. We can see that
other metric files are used. Of course, OFS (like NFSS) keeps track of
different metric files for different fonts sizes if this feature is
available. Next, we changed to "8t" font encoding (T1 by \LaTeX{}
terminology). Now, the Computer Modern Roman is
implemented by EC fonts. The encoding "6a" mentioned last means T2A
encoding for Cyrillic. The font family Computer Modern Roman
is implemented by LH fonts ("larm*.tfm") for this encoding.

Macro "ofstest.tex" gives you the possibility to make short font
catalogues. For example, I have loaded "ofstest [pantyk]", removed
default families by "\remdecl defaults", chosen all families
by "*" and printed a short font catalogue by "\abet" command. You can
see the result in picture~2.

\topinsert
\epsfxsize=\hsize \epsfbox{antykwa.eps}
\medskip
\centerline{Picture 2. A short catalogue of Antykwa Toru\'nska}
\bigskip
\hrule
\endinsert

I have printed for myself such a short catalogue of all fonts installed on
my computer. There are hundreds families and thousands variants listed. This
short catalogue is my ``reference book'' when I need to select some
interesting font for my work. Let me circulate this ``reference book''
as an example around this lecture room...

It is irrelevant whether you are a plain\TeX{} user, a \LaTeX{} 
user, a Con\TeX{}t
user or whatever else user because you can do this font test outside
of your document. I hope that the "ofstest.tex" macro
described in this section would be useful for you even if you have to use
"tex" or "csplain" command in order to run the "ofstest.tex" macro.
I mean that it is not important for you. The goal is achieved: you
have a good control over your fonts. You can "\list" your chosen font
family and read the metric name. Then you can use a primitive "\font"
in your document. Of course it is not a very good idea...


\kap Basics about OFS itself
%---------------------------

The OFS was designed and finely tuned for plain\TeX{} because I am
a plain\TeX{} user. Nevertheless there exists OFS for \LaTeX{} too with
the same user environment because \LaTeX{} users ask me to do it.
I never use \LaTeX{} because I have no control over all aspects of my
document in \LaTeX{}.

OFS implements (apart from others things) features similar to NFSS:
font selection independent on encoding/size/family/variant. The
code for plain\TeX{} does not use NFSS and implements all features
by itself. On the other hand, the \LaTeX{} variant of OFS is based on NFSS. 
Roughly speaking, the \LaTeX{} version of OFS implements only a user
environment and dictionary which converts the family names from human
readable form to NFSS cryptic names (such as "pbk" for Bookman).

The differences between OFS for plain\TeX{} and OFS for \LaTeX{} are
explained in detail in documentation~\cite{ofsdoc}. 
For example, you have to include the OFS macro in plain\TeX{}
in a little bit different way:

\begtt
\input ofs [declaration, files]
\endtt
%
than in \LaTeX{}: 

\begtt
\usepackage [declaration, files] {ofs}
\endtt
%
All other user-level commands have the same syntax and meaning.%
\footnote{Note that some parts of the article about the use of OFS
have similar (or somewhere the same) text as article~\cite{ofs2003}.}

You can use the command "\fontusage". This command prints to the
terminal and to the log file the basic usage of OFS:

\begtt
$ @=tex ofs \\fontusage=
This is TeX, Version 3.14159 (Web2C 7.3.7x)
encTeX v. Jun. 2004, the reencoding enabled.
(/usr/TeX/texmf/tex/ofs/ofs.tex
OFS (Olsak's Font System) based on plain initialized. <May 2004>
(/usr/TeX/texmf/tex/ofs/ofsdef.tex))
\fontusage: ============== Olsak's Font System, usage: =================
\input ofs [sjannon, sdynamo, a35] \loadingenc=1  ... for example
\showfonts  ... shows all loaded font families (by previous \input)
\setfonts [Family/] ... local switch to the new family, after this, the
  \rm, \bf, \it, bi will switch to the variants. The current size is used.
\setfonts [/size] ... local switch to the new size of fonts, the family is
  not changed. The "size" has the following possible formats:
    at<dimen>       ... the same as \font\something=file at<dimen>
    <dimen>         ... the same as at<dimen>
    <number>        ... the same as at<number>pt
    scaled<number>  ... the same as \font\something=file scaled<number>
    mag<decimal-number> fonts will be magnified by given coefficient
                        depend on current size of the fonts.
\setfonts [Family/size] ... switch to the new family at given size
\setfonts [Family-bf/size] ... switch to the specified font.
\fontdef\name [Family/size] ... same as \gdef\name{\setfonts[Family/size]}
  The "Family" or "size" parameter may be empty.
\fontdef\name [Family-vr/size] ... \name is fixed-font switch iff:
  "size" is no empty and no mag<dec-number>.
  Fixed-font switch "\name" is implemented as \global\font\name=file.
\setmath [size/size/size] ... set math it/rm as current it/rm + use PS Symbol
\nofontmessages, \logfontmessages, \displayfontmessages, \detailfontmessages
  ... the levels of log.
\endtt

The "\showfonts" prints the initialised font families. You can include the
OFS macro without additional declaration files in square brackets
(that is, use only "\input ofs"). In such situation, 
the basic six font families (as mentioned in
previous section) are initialized.

\begtt
*@=\showfonts=
OFS (l.0): The list of known font families:
defaults:
   [CMRoman/]            \rm, \bf, \it, \bi, \sl
   [CMSans/]             \rm, \bf, \it,  - 
   [CMTypewriter/]       \rm,  - , \it,  - , \sl
   [Times/]              \rm, \bf, \it, \bi
   [Helvetica/]          \rm, \bf, \it, \bi, \nrm, \nbf, \nit, \nbi
   [Courier/]            \rm, \bf, \it, \bi
\endtt
%
This is the same listing as shown in the previous section.
The family names are printed in square brackets here and followed by variant
switches available for each font family.

The basic fonts from Computer Moder family (by Donald Knuth) are
collected into three families here: "CMRoman", "CMSans" and 
"CMTypewriter". This is self explanatory. Note that the common
variant "BoldItalic" ("\bi") is missing in "CMSans" and
"CMTypewriter". On the other hand, the 
``special'' variant "\sl" (slanted) is available in 
"CMRoman" and "CMTypewriter" families.

The declaration files (other font families are declared here)
can be included in your document using syntax with square brackets or
you can "\input" them explicitly. Then you need not use "\input ofs"
because declaration files are able to "\input ofs"
automatically if this macro is not included before.

When you write "$ tex allfonts \\showfonts \\end | less", you get the
listing of all font families available in your \TeX{} distribution. 
This is another way to get this listing without using the "ofstest.tex"
macro.

If you need to recall what the special variant switches mean
("\nrm" in Helvetica family, for instance), you can try 
to switch to this family and look to the log file 
(or to the terminal if "\displayfontmessages" is set):

\begtt
*@=\displayfontmessages \setfonts [Helvetica/]=
OFS (l.0): Font family Helvetica at10pt (enc=8z) activated:
OFS (l.0):  \rm () \bf (Bold) \it (Oblique) \bi (BoldOblique)
OFS (l.0):  \nrm (Narrow) \nbf (NarrowBold) \nit (NarrowOblique) 
\nbi (NarrowBoldOblique)
*
\endtt

Oh yes, "\nrm" means Narrow variant of Helvetica family. You can see
that "\it" sometimes means the "Italic" variant and sometimes the "Oblique"
variant. 


\kap The setfonts command

You can select the font family and/or font size by the "\setfonts"
command. Two parameters separated by a slash are in square brackets. 
The first parameter is the font family name and the second one is the
font size. If one of the parameters is missing then its aspect stays
unchanged. After the font family is selected, you can use the variant
switches. Most common switches are "\rm", "\bf", "\it", "\bi", but
other switches can be available for some font families. See the
listing produced by "\showfonts" for more detail.

The "\setfonts" command keeps the variant from previous family
unchanged after setting of the new family if the current variant is
available in new font family. If not then the "\rm" variant is
initialized. All families have to support at least the "\rm" variant.

Examples:

\begtt
\input ofs [pantyk]
\setfonts [AntykwaTorunska/10.5]  % the normal font
\setfonts [/14]\bf                % used for titles
\setfonts [/8]\rm                 % for footnotes
\setfonts [Helvetica/]\it         % for citations
\setfonts [CMTypewriter/]         % monospaced font
\endtt

The main advantage is that you can use the same names of font families
as in Typo-catalog and you need not remember the cryptic names of tfm
files or abbreviations of family names in NFSS. 

If the family name is not present in the internal OFS dictionary
(perhaps misspelling), then the "\setfonts" command prints a warning plus
all available families to log and to the terminal (just like the
"\showfonts" command).

The font size can be specified as a decimal number without unit 
(the unit "pt" is appended automatically) or you can type number with
an arbitrary \TeX{} unit (``"mm"'' for example). Moreover, you can use the
keyword ``"scaled"'' before number with the same meaning as in the "\font"
primitive. OFS introduces the new keyword ``"mag"'' followed by a decimal
number (decimal point is required). This number denotes the fraction
for the current font size. For example:

\begtt
\def\smaller{\setfonts [/mag0.8]}
This text is {\smaller typeset by small \smaller and smaller
\smaller and still smaller characters} and the normal size is used
here.
\endtt
%
yields:

\medskip
\def\smaller{\setfonts [/mag0.8]}
This text is {\smaller typeset by small \smaller and smaller
\smaller and still smaller characters} and the normal size is used
here.
\medskip

We can use this feature in the \LaTeX{} logo, for example:

\begtt
\def\LaTeX{L\kern-.2em\raise.45ex\hbox{\setfonts[/mag.7] A}\kern-.05em\TeX}
\endtt

This solution works in titles (the raised ``A'' is bold in such a situation),
in normal text, footnotes, italics \etc. and in all font families.
This feature is not implemented in NFSS and so the \LaTeX{} logo has its
``A'' implemented as superscript math font in \LaTeX{} kernel. I think that
this is not the best idea.

Another usage of mag keyword is to make corrections of not
perfectly the same visual ex height of used font. This problem arises
for instance if you combine the CMTypewriter family with some common PostScript
font families. The CMTypewriter font seems to be smaller
if you use exactly the same design size. This is no problem:
you can define "\tt" as "\setfonts [CMTypewriter/mag1.1]" and the ex
height is balanced. This definition works in all sizes and font
variants.

The NFSS keeps track of another aspect of fonts: the ``font weight''. The main
reason of this feature is to keep boldface text 
(in titles, for example) including
its italics part. I decided that this feature is not needed in OFS
because users can define titles in the following way:

\begtt
\def\chapterfont {\setfonts[/14]\bf \let\it=\bi}
\endtt
%
Moreover, you can simply define macros which keep more than five
aspects (NFSS keeps exactly five aspects). You can find examples
in the \TeX{} support of \v Storm's font, 
where the big DynaGrotesk family implements
a special font selector that keeps the level of ``condensation of
the font'' in addition to the weight, variant (normal/italics), size
and encoding. 

There exist another task with font variants which cannot be solved by
a simple command "\let\it\bi" (sounds like a famous song from Beatles).
Imagine that you need to implement the footnote pointers as raised and
smaller text which copies the "\rm" variant and "\bf" variant but we need
to disable the "\it" variant. The footnote pointers have to be like this:

\def\disableitalic{%
   \ifx\currentvariant T\let\currentvariant=M\fi
   \ifx\currentvariant I\let\currentvariant=F\fi
}
\def\fnmark#1{\raise.8ex\hbox{\disableitalic\setfonts[/mag.7]#1}}

Normal\fnmark{1a} text, {\bf bold\fnmark{2b} text}, {\it italic\fnmark{3c}
text\/} and {\bi bolditalic\fnmark{4d} text}.

The solution which works for all font sizes, font families \etc. is as follows:

\begtt
\def\disableitalic{%
   \ifx\currentvariant T\let\currentvariant=M\fi % \it -> \rm
   \ifx\currentvariant I\let\currentvariant=F\fi % \bi -> \bf
}
\def\fnmark#1{\raise.8ex\hbox{\disableitalic\setfonts[/mag.7]#1}}
\endtt
%
Of course, this solution uses some ``internals'' from OFS for plain\TeX{}.
You need to know something about font variant representation in OFS. 
These internals are documented in~\cite{ofsdoc}, section~3.3. 

\kap Font declarations
%---------------------

The features mentioned here are intended for plain\TeX{} users.
NFSS has a different philosophy and \LaTeX{} users can read section
2.5 from~\cite{ofsdoc} for more details.

It would be best to concentrate all font declarations to one 
place in your macro code for your plain\TeX{} document. OFS is able to satisfy
this need. Imagine some common document with sections,
footnotes and running headers. You can declare fonts for this document 
by following code:

\begtt
\input ofs [ffonts]                    % font Charter is in free fonts
\setfonts [Charter/10pt]               % default family
\fontdef \tt [CMTypewriter/mag1.1]     % monospaced font
\fontdef \headfont [!/9]               % font for headers
\addcmd  \headfont {\it \let\bf=\bi}
\fontdef \footnotefont [!/8]           % smaller font for footnotes
\addcmd  \footnotefont {\baselineskip=10pt\rm}
\fontdef \sectionfont [!/12]           % section titles are bold at 12pt
\addcmd  \sectionfont {\bf \let\it=\bi}
\fontdef \titlefont [!-bf/14.4]        % title of the document
\endtt

Roughly speaking, "\fontdef <csname> [<Family>/<size>]" defines
<csname> as "\setfonts[<Family>/<size>]". 
The "\addcmd <csname> {<commands>}" adds
to the contents of macro <csname> new <commands>.

The ``"!"'' instead font family name means that a current font family is
used here. The
command "\fontdef" replaces ``"!"'' by the current family (Charter in our
example), thus the macro <csname> is defined as
"\setfonts[Charter/<size>]". This is something different from 
"\fontdef <csname> [/<size>]", which defines <csname>
as "\setfonts[/<size>]". Such a font selector keeps the family when
it is used. The~``"!"'' convention enables you to store the main font
family only at one place. You can change the word "Charter" to
something else at the second line in our example and the whole document will be
typeset by this other font family.

You can see that the last line of our example declares the title font
by "\fontdef" as ``"[Charter-bf/14.4]"''. On the other hand the
"\sectionfont" is declared as ``"[Charter/12]\bf"''. Where is
difference? The "\titlefont" is equivalent to a {\it single font}
described as ``"[Charter-bf/14.4]"''. It means that the "\titlefont" is the
same font selector as if "\font\titlefont=..." is used. On the other
hand, "\sectionfont" is a font family selector: it initializes the whole font
family and sets the "\bf" variant as default. There are
consequences of this difference: variant switches will work
incorrectly in the title of a document but they will work correctly in titles
of sections. The author of these macros assumes that the title of a document
will be printed only by a single font (for example he knows the text 
of this title).

You can see that plain\TeX{} users have to set the "\baselineskip"
for each font size manually. The previous example shows that
footnotes will be typeset by a different "\baselineskip". The
section titles are supposed to be short (one line), thus 
"\baselineskip" is not set here.

Why the "\footnotefont" and "\headfont" is declared by an explicit font
family name? Why 
"\fontdef\footnotefont[/8]" or "\fontdef\headfont[/9]" is not 
sufficient? The answer is simple:
the footnote or "\output" routine (which makes headers)
can be run while the "\tt" font family is active. In such 
a situation the solution "\fontdef\footnotefont[/8]" gives bad result. 

OFS provides "\knownfam" and "\ifknownfam" commands.
You can test by these commands whether given font family is installed in
OFS. This feature gives you the possibility to interchange the
document source between many users. Each of them can own a
different font collection. The following macro code defines
"\selectfam" command which selects the first available font family from
the given list:

\begtt
\input ofs [allfonts]
\def\selectfam #1[#2]{\def\tmp{#1}\doselectfam #2,],}
\def\doselectfam #1#2,{%
  \if #1]\errmessage{\string\selectfam: unknown families}%
  \else
     \knownfam #1#2?   % is the family #1#2 installed?
     \iftrue
        \expandafter\def\tmp{#1#2}% family is found
        \def\tmp##1],{}% ignore rest of families
        \expandafter\expandafter\expandafter\tmp
     \else
        \expandafter\expandafter\expandafter
        \doselectfam
  \fi\fi
}
\selectfam \antikva [TyfaText, PreissigText, AntykwaTorunska, Times]
\selectfam \grotesk [DynaGroteskR, FuturaBT, Helvetica]

\setfonts [\antikva/10]
\fontdef \sans [\grotesk/]
\fontdef \citefont [\grotesk-it/9]
...
\endtt
%
The list of families in "\selectfam" parameter should be ended by a family
from collection of six default families which are installed on each
OFS-\TeX{} system.


\kap Font encoding
%-----------------

OFS for plain\TeX{}% 
   \footnote{OFS for \LaTeX{} does not solve font encoding,
             use NFSS tools for font encoding manipulation}
initializes the CSfont encoding by default.
This does not matter for English users because CSfonts have absolutely
the same encoding(s) as Computer Modern in slots 0 to 127.
The users of T1 encoded fonts have to set the default font encoding by
the code: "\def\fotenc{8t}" before OFS is loaded. The encoding names
are inspired by~\cite{berry} by Karl Berry.

Theoretically, you can switch between encoding inside the
document but this is not a common practice:

\begtt
\input ofs
\setfonts [Times/]  text 1 % used metric: ptmr8z, CSfont encoding
\def\fotenc{8t}
\setfonts [/]       text 2 % used metric: ptmr8t, T1 encoding
\endtt
%
If you are using another font encoding with metric names "*xy" (for
example) then you can do "\def\fotenc{xy}", no problem there.

You can find the files "ofs-8z.tex", "ofs-8t.tex", "ofs-8c.tex" \etc. in
the OFS package. The accent declarations and other encoding-dependent
macros are situated there. By default, none of these files is read. It
means that the accent macros keep their original meaning from
plain\TeX{}.  You can use "\input" on one or more of these files
(there are no conflicts in these files).
After an encoding file is read then the original meaning of plain\TeX{}
macros like "\'", "\v", "\ss" is lost, of course. 

If you set "\loadingenc=1" then OFS reads the files
"ofs-<encoding>.tex" automatically when first "\setfonts" with given
"\fotenc" occurs. The declarations are then stored globally
and files are read in special mode where spaces at end of lines and
empty lines are ignored. Default is "\loadingenc=0" (users have to load
encoding files manually) but "\loadingenc=1" is highly recommended.

After encoding files are read then accent macros (such
as "\v", "\'" etc.) followed by a character, or glyph macros 
(such as "\promile") expand to character codes depending on 
the actual content of "\fotenc" macro.

You can look at some parts of "ofs-8z.tex" and "ofs-8t.tex" files:

\begtt
%%% Default accents in CM
\accentdef  \` *    8z  {\accent 18 }                   % grave
\accentdef  \' *    8z  {\accent 19 }                   % acute
\accentdef  \v *    8z  {\accent 20 }                   % caron
\accentdef  \u *    8z  {\accent 21 }                   % breve
...
%%% Standard characters in plain (redefined here)
\def\aa{\r a} 
\def\AA{\r A}
\characterdef \i    8z  16 
\characterdef \j    8z  17
\characterdef \SS   8z  {SS}
\characterdef \AE   8z  29
...
%%% Extra characters from CS fonts
\characterdef \promile      8z  141
\characterdef \varhyphen    8z  156
\characterdef \flqq         8z  158
\characterdef \frqq         8z  159
\characterdef \clqq         8z  254
\characterdef \crqq         8z  255
...
%%% Accented letters from CS fonts
\accentdef  \` A      8z  152
\accentdef  \' A      8z  193
\accentdef  \" A      8z  196
\accentdef  \` a      8z  184
\accentdef  \' a      8z  225
...
%%% Default accents in Cork
\accentdef  \` *    8t  {\accent 0 }               
\accentdef  \' *    8t  {\accent 1 }
\accentdef  \^ *    8t  {\accent 2 }
\accentdef  \~ *    8t  {\accent 3 }
\accentdef  \" *    8t  {\accent 4 }
...
%%% Standard characters in plain (redefined here)
\def\aa{\r a} 
\def\AA{\r A}
\characterdef \i    8t  25
\characterdef \j    8t  26
\characterdef \SS   8t  223
\characterdef \AE   8t  198
...
\characterdef \promile              8t {\%\char 24 }        
\characterdef \textpertenthousand   8t {\%\char 24\char 24 } 
...
%%% Accented letters from T1 encoding
\accentdef  \. i    8t `\i
\accentdef  \u A    8t 128
\accentdef  \k A    8t 129
\accentdef  \' C    8t 130
\accentdef  \v C    8t 131
...
\endtt

This example is self-explanatory and illustrates the language for
accents and encoding-dependent macro declarations. You can find more
information in documentation~\cite{ofsdoc}.

OFS takes into account the possibility of existence of a special metric
with extra characters (like "\euro"). Each basic metric can be
connected with such an ``extra metric'' into a couple. These couples are
used (for example) for CMRoman family, where basic metric depends on
"\fotenc" and extra metric is an EC companion font encoded by "8c"
encoding.  If the extra metric is declared and a user
calls the "\characterdef"ed or "\accentdef"ed macro and this
macro is not declared for current encoding but only for the
extra metric encoding, then the font with extra metric is temporarily 
used without any user intervention. Example:

\begtt
\characterdef \euro           8c  191
Now the \euro{} works in all fonts with extra metric *8c.
If basic encoding includes \euro{} then basic metric is used 
else extra metric is used for printing of this single character.
\endtt

Unfortunately, not all fonts have exactly all characters equal to
characters defined in used encoding.
Sometimes some glyphs are missing or there are
more glyphs in a font than characters declared by encoding.
These {\it exceptions\/} can be saved
by OFS macros for each font family, thus OFS exactly knows what
characters are available and what characters are unavailable in
the current family. Each font family can be connected to a list of
modifications of standard encoding. For example, font "ptmr8c" which
is used as an extension for Times family does not include the Euro symbol,
but "8c" encoding defines it at slot 191. This is the reason why the
"\characterdel\euro" command is used in "ofs-8c.tex" file in a
special list of modifications (named "8c:poor"). The Times family 
is connected to this "8c:poor" list in its declaration file 
(see the next section). You can try the following code:

\begtt
\input ofs \loadingenc=1
\setfonts [CMRoman/] I try to use \euro{} in Computer Modern.
\setfonts [Times/]   I try to use \euro{} in Times.
\endtt
%
OFS uses Euro symbol from an extra metric in the CMRoman family, but
when Times is activated then the Euro is lost.
OFS prints the following warning:

\begtt
OFS (l.3): WARNING. Command \euro is unavailable in Times (8z)
\endtt
%
You can define the default behavior for "\euro", for example:

\begtt
\input ofs \loadingenc=1
\characterdef \euro  * {Euro}  % print the text ``Euro''
\setfonts [CMRoman/] I try to use \euro{} in Computer Modern.
\setfonts [Times/]   I try to use \euro{} in Times.
\endtt
%
Now the missing "\euro" will be substituted by text ``Euro'' for all font
families where "\euro" is unavailable. If "\euro" is available
then the character from basic or extension metric will be used, of course.

A similar feature is implemented for "\accentdef"ed characters. 
You can find more information about exceptions from standard encodings
in~\cite{ofsdoc}.

I think that Knuth's "\mathhexbox" macro for text characters (like "\S") 
is a somewhat bad idea because the result is dependent on setting of
math fonts (no text fonts), it is independent of text font size and text
font variant. This is the reason why OFS defines "\ofshexbox" macro
which respects font size and font variant (if the current variant is
a ``standard'' one "\rm", "\it", "\bf", "\bi"). First, you can
declare the ``special font family'' by:

\begtt
\ofshexboxdef {<name>} {<rm>} {<bf>} {<it>} {<bi>}
\endtt
%
where <name> is a name of this special family, <rm>, <bf>, <it>, <bi>
are metric files for given variants. Then the command
"\ofshexbox <name><hexa code>" prints the glyph from slot of <hexa code>
from one of four declared metric files.
It keeps the current variant and current font size (the metric files are
internally loaded by "\font\... <metric file> at<current fontsize>"). For
example:

\begtt
\ofshexboxdef {eurosym}{feymr10}{feybr10}{feymo10}{feybo10}
\characterdef \euro * {\ofshexbox{eurosym}65}
\endtt
%
is another solution of ``missing Euro'' problem for families where
"\euro" is unavailable.%
\footnote{The metric files in this example are loaded 
          from {\tt eurosym} package.}



\kap Declaration files
%---------------------

Look into "a35.tex" now for an example of language of 
declaration files:

\begtt
%%% Times, Helvetica, Courier is in OFS defaults

\ofsdeclarefamily [AvantGarde] {% -------------------- AvantGarde
   \loadtextfam (Book)         pagk\fotenc;%      \rm
                (Demi)         pagd\fotenc;%      \bf
                (BookOblique)  pagko\fotenc;%     \it
                (DemiOblique)  pagdo\fotenc;8c;%  \bi
   \def\TeX{T\kern-.08em\lower.3333ex\hbox{E}\kern-0.09emX}%
   \modifyenc 8z:badaccents;%
   \modifyenc 8t:losschars;%
   \modifyenc 8c:poor;%
}
\registerenc: 8z  \registerenc: 8t

\ofsdeclarefamily [Bookman] {% ----------------------- Bookman
   \loadtextfam (Light)        pbkl\fotenc;%      \rm
                (Demi)         pbkd\fotenc;%      \bf
                (LightItalic)  pbkli\fotenc;%     \it
                (DemiItalic)   pbkdi\fotenc;8c;%  \bi
   \def\TeX{T\kern-.14em\lower.4ex\hbox{E}\kern-.125emX}%
   \modifyenc 8z:badaccents;%
   \modifyenc 8t:losschars;%
   \modifyenc 8c:poor;%
}
\registerenc: 8z  \registerenc: 8t
...
\endtt
%
The mapping between font family names and metric files is defined
here.%
\footnote{OFS for \LaTeX{} uses other declaration files {\tt*.sty}.
          The mapping between family names and NFSS short names
          are defined there.
}
Each family declares four metric files for four common variants "\rm",
"\bf", "\it" and "\bi". Empty parameter means that the variant 
is missing. The metric names include "\fotenc" in order to get names
"pagk8z", "pakg8t", \etc. after expansion. 
The extra metric "8c" is declared before the last semicolon. 
The commands from parameter of the "\ofsdeclarefamily" are processed
when "\setfonts" is used. You can see the alternative definition of
\TeX{} logo here. It optimizes the
visual aspect of this logo specially for each font family.

The optional parameters of "\loadtextfam" macro are written in brackets
and these parameters declare mapping from short variant switches to
the full variant names printed to the log and terminal. For example,
"\it" variant is BookOblique in AvantGarde font family. If the
common name is used (Bold/Italics/BoldItalics) then this parameter can
be missing. 

The "\modifyenc" commands make connections of the family to exception
lists from standard encoding. For example, the "8c:poor" list was
mentioned in the previous section.

Finally, the "\registerenc" commands say that the declared family is
ready to be used in specified encodings. The AvantGarde and Bookman 
family have registered only "8z" and "8t" basic encodings. It means 
that these families are not available in other encodings.

How is the "CMRoman" family declared? This family includes two
special features. First: the metric file names do not include the "8z" or
"8t" acronym for encoding. Second: different metric names are used
for different font sizes. Both problems are solved by the command
"\registertfm" (see the "ofsdef.tex" file): 

\begtt
\registertfm cmr8z     -      csr10  % metric for all sizes
\registertfm cmr8z  0pt-6pt   csr5
\registertfm cmr8z  6pt-7pt   csr6
\registertfm cmr8z  7pt-8pt   csr7
\registertfm cmr8z  8pt-9pt   csr8
\registertfm cmr8z  9pt-10pt  csr9
\registertfm cmr8z  10pt-12pt csr10
\registertfm cmr8z  12pt-17pt csr12
\registertfm cmr8z  17pt-*    csr17
...
\registertfm cmr8t     -   dcr10     % metris for all sizes
...
\ofsdeclarefamily [CMRoman] {% ------------ Computer Modern Roman
   \loadtextfam cmr\fotenc;%        \rm
                cmbx\fotenc;%       \bf
                cmti\fotenc;%       \it
                cmbxti\fotenc;8c;%  \bi
   \newvariant8 \sl   (Slanted)     cmsl\fotenc;8c;%
   \newvariant9 \bxsl (BoldSlanted) cmbxsl\fotenc;8c;%
   \modifyenc 8z:csfont;%
}
\registerenc: 8z  \registerenc: 8t  \registerenc: 6a
\endtt

Look at other declaration files for more examples. Look at
documentation~\cite{ofsdoc} for detailed information about syntax and
sematic of commands used here.


\kap Math fonts
%--------------

The math fonts are collected in math families (three fonts 
per one family)
by "\textfont", "\scriptfont" and "\scriptscriptfont" primitives.  The
math families with number 0, 1, 2, 3 have special meaning in math
typesetting. The declaration of a new math family by \TeX{} primitives
is not too comfortable. Plain\TeX{} users can declare a new math
family by OFS macro "\loadmathfam". This command will be described
below.

Plain\TeX{} user have to initialize the math fonts in OFS by
"\setmath" command. The math fonts are in the same state as declared
in plain\TeX{} macro until the "\setmath" command is used. It means
that the Computer Modern at 10/7/5 pt size are used.
The "\setmath" command has three parameters 
separated by slashes enclosed in square brackets.
These parameters describe the
text/script/scriptscript size of the math fonts. An empty parameter
means that the mag1.0/mag.7/mag.5 (relatively to the current size of
textual font) is substituted:

\begtt
\setmath [//] is the same as \setmath [mag1.0/mag.7/mag.5]
\endtt

The "\setmath" command calculates the needed sizes from given
parameters and starts the "\mathfonts" macro followed by macro
"\mathchars". A plain\TeX{} user can define these macros in 
his own way but OFS gives the reasonable default meaning of these
macros. The outcome of these default macros depends on the
values of the "\fomenc" and "\mathversion" macros.

If "\def\fomenc{PS}" is used (it is default value in OFS) then "\setmath"
initializes math fonts in the following way: math italic is loaded
from text italics of the current text font family, family~0 is loaded
from "\rm" variant of the current family. The math symbols are loaded
(if it is possible) from common PostScript font Symbol. The rest
(which is not included in Symbol font) is loaded from Computer Modern
fonts. The math encoding is redefined (by "\mathchardef" \etc. primitives) 
for many symbols in order to keep the accessibility of all math 
characters declared in plain\TeX{}. For example the lower letter Greek
characters are loaded from slanted variant of PostScript Symbol font.

If you write "\def\fomenc{CM}" then "\setmath" loads the math fonts from
Computer Modern family (like in plain\TeX) and does not change the math encoding.
In this case, the "\setmath[//]" command only sets the actual sizes of
these fonts depending on current text font size. 

After "\input txfn.tex" you can write "\def\fomenc{TX}" or
"{PX}". The free available TX fonts are used in such
case for math typesetting.  They are very similar to Times
and Helvetica families and they include a large set of math glyphs. 
"\def\fomenc{TX}" means that all math typesetting will be
realized by TX fonts. If "\def\fomenc{PX}" is set then math italic
and family 0 is copied from the current text font family.%
\footnote{%
Please, return to the section~2, picture~1. This picture does not
illustrate exactly the output from {\tt ofstest} example mentioned in this
section. In fact, the math typesetting sample was printed by
{\tt\char`\\def\char`\\mathenc\char`\{PX\char`\}} {\tt\char`\\math} commands.
}

After "\input amffn.tex" you can write "\def\fomenc{AMS}". AMS fonts
will be used. 

If you buy the MathTimes family, you can do "\input mtfn.tex"
and you can use "\def\fomenc{MT}".

You can control the math families collection loaded by "\setmath" by
the value of "\mathversion" macro. OFS declares two
math family collections: "\def\mathversion{normal}"
and "{bold}". You can declare more collections if you need it.
The ``"bold"'' collection is the same as ``"normal"'', but bold variants of
italics, family~0 and math symbols (if accessible) are loaded
instead normal variants.

The example from "ofsdef.tex" file illustrates the language of
declarations of the math fonts:

\begtt
\def\loadPSnormalmath{%
  \loadmathfam 0[-rm/]%                Actual Roman font
  \loadmathfam 1[-it/]%                Actual Italic font
  \defaultskewchar=48
  \loadmathfam 2[/cmsy]%               Standard symbols from CM
  \defaultskewchar=-1
  \noindexsize\loadmathfam 3[tenex/]%  Standard extra symbols from CM
  \chardef\symbfam  4
  \loadmathfam \symbfam [/psyr]%       PostScript Symbol
  \chardef\symbofam 5
  \loadmathfam \symbofam [/psyro]%     PostScript Symbol Oblique
  \chardef\bffam    6
  \loadmathfam \bffam [-bf/]%          Actual Bold font
  \chardef\bifam    7 
  \loadmathfam \bifam [-bi/]%          Actual Bold Italic  
  \lastfam = 7  
  \chardef\itfam    1 
  \let\slfam\undefined \let\ttfam\undefined
  \setfosize \tmpa mag1.44:%
  \font \bigsymbofont=psyr \tmpa%      Big variant for \displaysize          
  \fontloadmessage{bigsymbofont}{psyr\space\tmpa}%
}
\def\loadPSboldmath{%
  \loadmathfam 0[-bf/]%                Actual Bold font
  \loadmathfam 1[-bi/]%                Actual Bold-Italic font
  \defaultskewchar=48
  \loadmathfam 2[/cmbsy]%              Bold symbols from CM
  \defaultskewchar=-1
  \noindexsize\loadmathfam 3[tenex/]%  Standard extra symbols from CM
  \chardef\symbfam  4
  \loadmathfam \symbfam [/psyr]%       PostScript Symbol
  \chardef\symbofam 5
  \loadmathfam \symbofam [/psyro]%     PostScript Symbol Oblique
  \lastfam = 7  % needs to be the same as in normal version
  \chardef\itfam    1 
  \chardef\bifam    1
  \chardef\bffam    0  
  \let\slfam\undefined \let\ttfam\undefined
  \setfosize \tmpa mag1.44:%
  \font \bigsymbofont=psyr \tmpa%      Big variant for \displaysize          
  \fontloadmessage{bigsymbofont}{psyr\space\tmpa}%
}
\def\loadCMnormalmath{%
  \loadmathfam 0[/cmr8z]%                    Roman font
  \defaultskewchar=128
  ...
  \lastfam =7
}
...
\endtt

If you need to add next math families (math alphabets in NFSS
terminology) then you can use the code similar as the following:

\begtt
\addcmd\mathfonts{%
  \newmathfam\bbfam 
  \loadmathfam \bbfam [/bbold12]%  BBfonts
  \def\bb{\fam\bbfam}%
}
\addcmd\mathchars{% 
  \mathchardef\balpha    "0\hex\bbfam 0B
  \mathchardef\bbeta     "0\hex\bbfam 0C
  ...
} 
\endtt

We can re-write the example from section~5 in order to support the math
typesetting: 

\begtt
\input ofs [ffonts] \loadingenc=1     % font Charter is in free fonts
\setfonts [Charter/10pt]              % default family
\input txfn \def\fomenc{PX}
\setmath[//]                          % math initialisation
\fontdef\tt [CMTypewriter/mag1.1]     % monospaced font
\fontdef \headfont [!/9]              % font for headers
\addcmd  \headfont {\it \let\bf=\bi \emath}
\fontdef \footnotefont [!/8]          % smaller font for footnotes
\addcmd  \footnotefont {\baselineskip=10pt\rm \emath}
\fontdef \sectionfont [!/12]          % titles are bold at 12pt
\addcmd  \sectionfont {\bf \let\it=\bi 
                       \def\mathversion{bold}\emath}
\fontdef \titlefont [!-bf/14.4]       % title of the document
\def\emath{\everymath={\setmath[//]}} % \setmath[//] only if $ is used
\endtt

The math fonts will work in all sizes (besides "\titlefont") in our
virtual example. The math formulae are in bold variant and in right
size in section titles. For normal font, "\setmath[//]" is initialized
on line~4 of our example. Other font selectors do not run
"\setmath[//]" when called, this command will be run only 
when \TeX{} enters to math mode (see "\everymath" trick).

Let me do the last test in this article. The following code is
appended to the previous example:

\begtt
\def\section #1{\bigskip{\sectionfont#1\par\nobreak}\medskip}
\detailfontmessages

\section {Theorem $a^2+b^2=c^2$}

\hbox to0pt{Normal text.} % Test of overfull message
\end
\endtt
%
The log file after "tex test" follows:

\begtt
This is TeX, Version 3.14159 (Web2C 7.3.7x) (format=plain 2003.2.18)
...
OFS (Olsak's Font System) based on plain initialized. <May 2004>
...
OFS (l.2): Font family Charter at10pt (enc=8z) activated:
(/usr/TeX/texmf/tex/ofs/ofs-8z.tex
OFS (l.57): Characters + accents of 8z encoding defined.
)
OFS (l.2):  \rm () \bf (Bold) \it (Italic) \bi (BoldItalic)
(/usr/TeX/texmf/tex/ofs/txfn.tex)
OFS (l.4): \setmath [at10.0pt/at7.0pt/at5.0pt] (enc=PX, version=normal)
 (/usr/TeX/texmf/tex/ofs/ofs-px.tex)
OFS (l.4): Math codes are set for PX encoding.
(/usr/TeX/texmf/tex/ofs/ofs-ams.tex)
OFS (l.4): Math symbols are set for AMS encoding.
 (/usr/TeX/texmf/tex/ofs/ofs-tx.tex)
OFS (l.4): Math symbols are set for TX encoding.
OFS (l.5): Define \tt as \setfonts [CMTypewriter/mag1.1].
OFS (l.6): Define \headfont as \setfonts [Charter/9].
OFS (l.8): Define \footnotefont as \setfonts [Charter/8].
OFS (l.10): Define \sectionfont as \setfonts [Charter/12].
OFS (l.13): Define \titlefont as fixed font [Charter-bf/14.4].
OFS (l.13): Loading single font Charter-bf at14.4pt (enc=8z).
\detailfontmessages:
OFS (l.19): Font family Charter at12pt (enc=8z) activated:
OFS (l.19):   \font\tenrm = bchr8z at12pt
OFS (l.19):   \font\tenbf = bchb8z at12pt
OFS (l.19):   \font\tenit = bchri8z at12pt
OFS (l.19):   \font\tenbi = bchbi8z at12pt
OFS (l.19):  \rm () \bf (Bold) \it (Italic) \bi (BoldItalic)
OFS (l.19): \setmath [at12.0pt/at8.4pt/at6.0pt] (enc=PX, version=bold)
OFS (l.19):   \font\-bf-Mt = bchb8z at12.0pt  (fam:0)
OFS (l.19):   \font\-bf-Ms = bchb8z at8.4pt  (fam:0)
OFS (l.19):   \font\-bf-Mss = bchb8z at6.0pt  (fam:0)
OFS (l.19):   \font\-bi-Mt = bchbi8z at12.0pt  (fam:1)
OFS (l.19):   \font\-bi-Ms = bchbi8z at8.4pt  (fam:1)
OFS (l.19):   \font\-bi-Mss = bchbi8z at6.0pt  (fam:1)
OFS (l.19):   \font\txbsy-Mt = txbsy at12.0pt  (fam:2)
OFS (l.19):   \font\txbsy-Ms = txbsy at8.4pt  (fam:2)
OFS (l.19):   \font\txbsy-Mss = txbsy at6.0pt  (fam:2)
OFS (l.19):   \font\txbex-Mt = txbex at12.0pt  (fam:3)
OFS (l.19):   \font\txbmi-Mt = txbmi at12.0pt  (fam:\mifam=4)
OFS (l.19):   \font\txbmi-Ms = txbmi at8.4pt  (fam:\mifam=4)
OFS (l.19):   \font\txbmi-Mss = txbmi at6.0pt  (fam:\mifam=4)
...
OFS (l.19):   \font\txb-Mt = txb at12.0pt  (fam:\rmsyfam=12)
OFS (l.19):   \font\txb-Ms = txb at8.4pt  (fam:\rmsyfam=12)
OFS (l.19):   \font\txb-Mss = txb at6.0pt  (fam:\rmsyfam=12)

Overfull \hbox (53.83992pt too wide) detected at line 21
\Charter-rm/at10pt Normal text.|
...
[1] )
Output written on test.dvi (1 page, 436 bytes).
\endtt

You can see that text the encoding file "ofs-8z.tex" and math encoding 
files "ofs-px.tex", "ofs-ams.tex", "ofs-tx.tex" are read automatically. 

A detailed report about the processing of all
"\font" primitives is logged as the outcome of "\detailfontmessages" command. 
The initialization of math fonts family at 12/8.4/6
in ``bold'' version is shown.

The ``overfull message'' prints the
font identifier like "\Charter-rm/at10pt". This is more legible
than cryptic font identifiers used in NFSS.

\reference

\bib \url{ftp://math.feld.cvut.cz/pub/olsak/ofs}.

\bib \url{www.stormtype.com}

\bib \url{www.cstug.cz/stormtype/slido.html}.

\bib Petr Ol��k. {\it OFS: Ol��k�v fontov� syst�m}. 2001.
     The English documentation is in files "ofsdoc-e.tex", "ofsdoc-e.pdf"

\bib Petr Ol��k, Petr Sojka. {\it The Font Management with the OFS.}
     Euro\TeX{}2003, Brest.\hfil\break
     The article is available only in draft
     version on\hfil\break \url{ftp://math.feld.cvut.cz/pub/olsak/ofs/papers/}

\bib Petr Ol��k. {\it Jak \TeX{} k~font�m ze St�e�ovic p�i�el}. Bulletin
     of CSTUG, number 4/2001, pp~153--180.

\bib Karl Berry. {\it Fontname}, March 1999. The documentation is included
     in {\tt web2c} \TeX, file {\tt fontname.texi}, {\tt fontname.pdf}


\bye 

