| 1 |
%% \CheckSum{26} |
| 2 |
% \iffalse (Comment) |
| 3 |
% This file contains a breif description of the T1R/zcm font family, |
| 4 |
% the code for its font definition file, and the code the ecsubzcm |
| 5 |
% package. |
| 6 |
% \fi |
| 7 |
% |
| 8 |
% \iffalse (Skip the driver code when DocInputting.) |
| 9 |
% (The driver code is still enclosed in a macrocode environment, just |
| 10 |
% in case.) |
| 11 |
% \begin{macrocode} |
| 12 |
%<*driver> |
| 13 |
\documentclass{ltxdoc} |
| 14 |
\newcommand\package[1]{\textsf{#1}} |
| 15 |
\title{The \texttt{zcm} example font family} |
| 16 |
\author{Lars Hellstr\"om% |
| 17 |
\thanks{E-mail: \texttt{[email protected]}}% |
| 18 |
} |
| 19 |
\begin{document} |
| 20 |
\maketitle |
| 21 |
\DocInput{t1rzcm.fdd}\Finale |
| 22 |
\begin{thebibliography}{9} |
| 23 |
\bibitem{ltoutenc} |
| 24 |
Johannes Braams, David Carlisle, Alan Jeffrey, Frank Mittelbach, |
| 25 |
Chris Rowley, Rainer Sch\"opf: \texttt{ltoutenc.dtx} (part of the |
| 26 |
\LaTeXe\ base distribution). |
| 27 |
\end{thebibliography} |
| 28 |
\end{document} |
| 29 |
%</driver> |
| 30 |
% \end{macrocode} |
| 31 |
% \fi |
| 32 |
% |
| 33 |
% \section{The \texttt{zcm} font family and \texttt{reldemo.tex}} |
| 34 |
% \label{zcm-family} |
| 35 |
% % |
| 36 |
% The \texttt{zcm} family of fonts consists of only two fonts and it is |
| 37 |
% meant to accompany the \package{relenc} package documentation. These |
| 38 |
% fonts are really just combinations of glyphs taken from other fonts, |
| 39 |
% primarily the Computer Modern fonts (hence the \texttt{cm}), but |
| 40 |
% there are also some glyphs which are taken from some \LaTeX\ symbol |
| 41 |
% fonts (\texttt{lasy10} and \texttt{lcircle10}). |
| 42 |
% |
| 43 |
% The primary reason these fonts exist is that I felt I needed an example |
| 44 |
% of what can be done with the \package{relenc} package. As one really |
| 45 |
% cannot expect that people will have any font that is not either a |
| 46 |
% Computer Modern or a \LaTeX\ font, such an example has to be made |
| 47 |
% using these fonts. I am well aware that some of the glyphs look |
| 48 |
% terrible, but the \texttt{zcm} family is not intended to be used |
| 49 |
% for any serious typesetting. |
| 50 |
% |
| 51 |
% The font family consists of two fonts: \texttt{zcmr8d} and |
| 52 |
% \texttt{zcmra}. The first of these is declared as |
| 53 |
% \texttt{T1R}\slash\texttt{zcm}\slash\texttt{m}\slash\texttt{n} and its |
| 54 |
% coding scheme is identical to that of the \texttt{T1} encoding. The |
| 55 |
% second is declared as \texttt{T1R}\slash\texttt{zcm}\slash |
| 56 |
% \texttt{m}\slash\texttt{a} and its coding scheme deviates from that of |
| 57 |
% the \texttt{T1} encoding in four slots, which have been reassigned to |
| 58 |
% contain ligatures instead of accented letters. |
| 59 |
% |
| 60 |
% A demonstration of these fonts is generated by typesetting |
| 61 |
% \texttt{reldemo.tex}; this document contains a font table listing the |
| 62 |
% contents of each slot, a demonstration of all the symbol commands, a |
| 63 |
% demonstration of the effects of applying the accenting commands to the |
| 64 |
% non-accented letters, and a comprehensive list of character pairs, for |
| 65 |
% both fonts. The reason I have put it in a separate file is (i) that |
| 66 |
% the \package{relenc} package will have to be installed before these |
| 67 |
% fonts can be viewed (the files needed are \texttt{relenc.sty}, |
| 68 |
% \texttt{t1renc.def}, and \texttt{t1rzcm.fd}) and (ii) that there |
| 69 |
% might be some problems connected to viewing these fonts. |
| 70 |
% |
| 71 |
% To begin with, both fonts are virtual fonts and some DVI drivers cannot |
| 72 |
% handle these. If you only have such drivers, you should get one that |
| 73 |
% can (not just for the sake of the \package{relenc} package---virtual |
| 74 |
% fonts are in general neat to be able to use). |
| 75 |
% |
| 76 |
% One of the fonts used to make these virtaul fonts---the |
| 77 |
% \texttt{lcircle10} font---occurs under two other names as well: |
| 78 |
% \texttt{circle10} and \texttt{lcirc10}. Unfortunately, one cannot |
| 79 |
% expect that there is more than one of these in any given \TeX\ ^^A |
| 80 |
% installation. Thus you will get some problems if your installation |
| 81 |
% uses another name for this font. Some DVI drivers will translate the |
| 82 |
% name used in the virtual font to that of the font names which actually |
| 83 |
% occurs in the system, and in this case there is no problem, but if not |
| 84 |
% then you will have to intervene yourself. |
| 85 |
% |
| 86 |
% The easiest way to do this is simply to rename a few virtual font |
| 87 |
% files, since there are such files accompanying the \package{relenc} |
| 88 |
% package for using the \texttt{lcircle10} font under any one of these |
| 89 |
% names. What you have to see too is that the ones which use the font |
| 90 |
% under the name on your system are the ones which are named |
| 91 |
% \texttt{zcmr8d.vf} and \texttt{zcmra.vf} respectively. The following |
| 92 |
% table shows what the file names are and which font it uses |
| 93 |
% $$ |
| 94 |
% \mbox{^^A |
| 95 |
% \begin{tabular}{cc} |
| 96 |
% Virtual font file& \texttt{lcircle10} name used^^A |
| 97 |
% \\[-0.9\ht\strutbox] |
| 98 |
% \hrulefill&\hrulefill\\ |
| 99 |
% \texttt{zcmr8d.vf}& \texttt{lcricle10}\\ |
| 100 |
% \texttt{zcmra.vf}& \texttt{lcricle10}\\ |
| 101 |
% \texttt{zcmr8d.vf2}& \texttt{cricle10}\\ |
| 102 |
% \texttt{zcmra.vf2}& \texttt{cricle10}\\ |
| 103 |
% \texttt{zcmr8d.vf3}& \texttt{lcric10}\\ |
| 104 |
% \texttt{zcmra.vf3}& \texttt{lcric10} |
| 105 |
% \end{tabular}^^A |
| 106 |
% } |
| 107 |
% $$ |
| 108 |
% Note that all the above files are virtual font files. The reason |
| 109 |
% only two have been given the correct suffix \texttt{.vf} is that there |
| 110 |
% really are no more than two fonts, so they should not take up any more |
| 111 |
% font name space than that either. |
| 112 |
% |
| 113 |
% Finally, there is one other use for the \texttt{T1R}\slash |
| 114 |
% \texttt{zcm}\slash\texttt{m}\slash\texttt{n} font---it is the final |
| 115 |
% substitution font in the \texttt{T1R} encoding. \LaTeX\ requires that |
| 116 |
% there is such a font, so it might as well be this one. This means that |
| 117 |
% you should see to that the files which are this font (\texttt{zcmr8d.tfm} |
| 118 |
% and \texttt{zcmr8d.vf}) are put in such locations that \TeX\ and its |
| 119 |
% helper programs (DVI drivers etc.) will find them if they are needed. |
| 120 |
% You should not need to move them before you typeset \texttt{reldemo.tex} |
| 121 |
% for the first time, however, as these fonts are initially in the same |
| 122 |
% directory as this and \TeX\ looks for files there first. |
| 123 |
% |
| 124 |
% If you do have the \texttt{ec} family of fonts however, you may (quite |
| 125 |
% understandably) want to use one of them as final substitution font for |
| 126 |
% the \texttt{T1R} encoding instead. There is a package called |
| 127 |
% \package{ecsubzcm} that is installed with \package{relenc}. This |
| 128 |
% package declares the \texttt{zcm} family in encoding \texttt{T1R} and |
| 129 |
% \texttt{ecrm1000} under the encoding\slash family\slash series\slash |
| 130 |
% shape combination \texttt{T1R}\slash\texttt{zcm}\slash\texttt{m}\slash |
| 131 |
% \texttt{n}. After loading this package, \LaTeX\ will not bother to |
| 132 |
% input the font definition file \texttt{t1rzcm.fd}, so the ``real'' |
| 133 |
% \texttt{zcm} fonts will not get involved. |
| 134 |
% |
| 135 |
% \section{Implementation} |
| 136 |
% \subsection{Font definition file} |
| 137 |
% |
| 138 |
% \StopEventually{} |
| 139 |
% |
| 140 |
% As is the custom, the file starts by announcing itself. |
| 141 |
% \begin{macrocode} |
| 142 |
%<*fd> |
| 143 |
\ProvidesFile{t1rzcm.fd}[1999/01/19 Font definitions for T1R/zcm.] |
| 144 |
% \end{macrocode} |
| 145 |
% |
| 146 |
% Then the family is declared. So far, there is nothing out of the |
| 147 |
% ordinary. |
| 148 |
% \begin{macrocode} |
| 149 |
\DeclareFontFamily{T1R}{zcm}{} |
| 150 |
% \end{macrocode} |
| 151 |
% |
| 152 |
% Next the shapes are declared. There is nothing strange about this |
| 153 |
% either. |
| 154 |
% \begin{macrocode} |
| 155 |
\DeclareFontShape{T1R}{zcm}{m}{n}{ |
| 156 |
<-> zcmr8d |
| 157 |
}{} |
| 158 |
% \end{macrocode} |
| 159 |
% \begin{macrocode} |
| 160 |
\DeclareFontShape{T1R}{zcm}{m}{a}{ |
| 161 |
<-> zcmra |
| 162 |
}{} |
| 163 |
% \end{macrocode} |
| 164 |
% |
| 165 |
% That would be all in a normal font definition file. This file does |
| 166 |
% however go on with defining some variants of commands and |
| 167 |
% compositions, to compensate for the differences between the coding |
| 168 |
% scheme of the \texttt{zcmra} font and the default coding scheme. |
| 169 |
% |
| 170 |
% Slot number 128 is used for a ligature instead of the default `\u{A}', |
| 171 |
% so this has to be compensated for. In this case it is done by making |
| 172 |
% another default definition of the |\u| command and defining all the |
| 173 |
% other compositions of that command again. |
| 174 |
% \begin{macrocode} |
| 175 |
\DefineTextAccentVariant{\u}{T1R}{zcm}{}{a}{8} |
| 176 |
\DefineTextVariantComposition{\u}{T1R}{zcm}{}{a}{G}{135} |
| 177 |
\DefineTextVariantComposition{\u}{T1R}{zcm}{}{a}{a}{160} |
| 178 |
\DefineTextVariantComposition{\u}{T1R}{zcm}{}{a}{g}{167} |
| 179 |
% \end{macrocode} |
| 180 |
% It should be noted at this point that this font definition file is |
| 181 |
% not set up in the most efficient way. Normally, one would want to |
| 182 |
% minimize the number of variants that needs to be defined---something |
| 183 |
% which the above most certainly does not do---and one often achieves |
| 184 |
% this by trying to affect as few accenting commands as possible. The |
| 185 |
% four extra ligatures of the \texttt{zcmra} font could have been put in |
| 186 |
% slots 128, 135, 160, and 167---that would have made it possible to |
| 187 |
% get by with the single variant definition |
| 188 |
%\begin{verbatim} |
| 189 |
% \DefineTextAccentVariant{\u}{T1R}{zcm}{}{a}{8} |
| 190 |
%\end{verbatim} |
| 191 |
% although a font designer who frequently use the |\u| command will |
| 192 |
% probably prefer to use slots for compositions of some other |
| 193 |
% command---but \texttt{zcmra} has been set up more to show what is |
| 194 |
% possible than what is optimal. |
| 195 |
% |
| 196 |
% The same problem occurs with slot 131, which does not contain the |
| 197 |
% `\v{C}' glyph that the encoding-level composition of |\v| with |C| |
| 198 |
% assumes it does. Another solution to the problem is to give an |
| 199 |
% explicit definition of the composition at a lower level, as in |
| 200 |
% \begin{macrocode} |
| 201 |
\DefineTextVariantCompositionCommand{\v}{T1R}{zcm}{}{a}{C}{% |
| 202 |
\add@accent{7}{C}% |
| 203 |
} |
| 204 |
% \end{macrocode} |
| 205 |
% |\add@accent| is standard \LaTeX\ and its definition can be found |
| 206 |
% in~\cite{ltoutenc}. This solution gets by using only two variants (the |
| 207 |
% \texttt{T1R}\slash\texttt{zcm}\slash\texttt{?}\slash\texttt{a} variant |
| 208 |
% of |\v|, and the compositon of that variant with |C|). Had instead |
| 209 |
% the first solution been used here, it would have required the code |
| 210 |
%\begin{verbatim} |
| 211 |
%\DefineTextAccentVariant{\v}{T1R}{zcm}{}{a}{7} |
| 212 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{D}{132} |
| 213 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{E}{133} |
| 214 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{L}{137} |
| 215 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{N}{140} |
| 216 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{R}{144} |
| 217 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{S}{146} |
| 218 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{T}{148} |
| 219 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{Z}{154} |
| 220 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{c}{163} |
| 221 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{d}{164} |
| 222 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{e}{165} |
| 223 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{l}{169} |
| 224 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{n}{172} |
| 225 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{r}{176} |
| 226 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{s}{178} |
| 227 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{t}{180} |
| 228 |
%\DefineTextVariantComposition{\v}{T1R}{zcm}{}{a}{z}{186} |
| 229 |
%\end{verbatim} |
| 230 |
% which defines another 18 control sequences. The |\v| command sure has |
| 231 |
% many compositions, hasn't it? |
| 232 |
% |
| 233 |
% Things are a bit different when the slot is used for a variant of a |
| 234 |
% composition, instead of a composition of a variant. In the former case, |
| 235 |
% there is a special command that can be used to extract the default |
| 236 |
% definition of the accenting command. |
| 237 |
% \begin{macrocode} |
| 238 |
\DefineTextUncomposedVariant{\'}{T1R}{zcm}{}{a}{C} |
| 239 |
% \end{macrocode} |
| 240 |
% |
| 241 |
% Finally, another example like |\v|. |
| 242 |
% \begin{macrocode} |
| 243 |
\DefineTextVariantCompositionCommand{\k}{T1R}{zcm}{}{a}{a}% |
| 244 |
{a\llap{\char12\kern-0.07em}} |
| 245 |
%</fd> |
| 246 |
% \end{macrocode} |
| 247 |
% This definition demonstrates that there is absolutely no need to base |
| 248 |
% the definition of a composition on the default definition; using that |
| 249 |
% in this case would (i) be much longer, (ii) be unstable, as the default |
| 250 |
% definition of |\k| positions the accent incorrectly if not both the |
| 251 |
% height of the accent and the depth of the letter is zero or less, |
| 252 |
% and (iii) probably not kern particularly good (at least this definition |
| 253 |
% kerns like `a' to the left, the default does not kern at all). |
| 254 |
% |
| 255 |
% |
| 256 |
% \subsection{The \package{ecsubzcm} package} |
| 257 |
% |
| 258 |
% \begin{macrocode} |
| 259 |
%<*package> |
| 260 |
\NeedsTeXFormat{LaTeX2e} |
| 261 |
\ProvidesPackage{ecsubzcm}[1999/01/19] |
| 262 |
% \end{macrocode} |
| 263 |
% \begin{macrocode} |
| 264 |
\DeclareFontFamily{T1R}{zcm}{} |
| 265 |
% \end{macrocode} |
| 266 |
% \begin{macrocode} |
| 267 |
\DeclareFontShape{T1R}{zcm}{m}{n}{ |
| 268 |
<-> ecrm1000 |
| 269 |
}{} |
| 270 |
%</package> |
| 271 |
% \end{macrocode} |
| 272 |
\endinput |
| 273 |
|