summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/type1cm/type1cm-doc.tex
blob: 2451581c9f066c7774f149aa90d8285c29a8ae33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
\documentclass[pagesize=auto]{scrartcl}

\usepackage{fixltx2e}
\usepackage{etex}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{microtype}
\usepackage{hyperref}

\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand*{\pkg}[1]{\textsf{#1}}
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
\makeatletter
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
\makeatother
\newcommand*{\opt}[1]{\texttt{#1}}

\addtokomafont{title}{\rmfamily}

\lstset{%
  language=[LaTeX]TeX,%
  columns=flexible,%
  upquote=true,%
  numbers=left,%
  basicstyle=\ttfamily,%
  keywordstyle=\color{Navy},%
  commentstyle=\color{DimGray},%
  stringstyle=\color{SeaGreen},%
  numberstyle=\scriptsize\color{SlateGray}%
}

\title{The \pkg{type1cm} package for \LaTeX\thanks{This manual corresponds to \pkg{type1cm.sty}~v0.04, dated~2002/09/05.}}
\author{David Carlisle\thanks{\mail{david@dcarlisle.demon.co.uk}}}
\date{2002/09/05}


\begin{document}

\maketitle

\noindent
\LaTeX\ separates its internal notion of font specification
from the external fonts available on the system by means of
`Font Shape Specifications', that are normally held in 
`Font Descriptor' (\textsc{fd}) files.

The \textsc{fd} files that come with \LaTeX\ that refer to the standard
Computer Modern set (and the related \AmS\ set) are based on
the classical bitmap fonts which are available in `magstep'
sizes only. For instance The specification of the main roman font is
%
\begin{lstlisting}
\DeclareFontShape{OT1}{cmr}{m}{n}
 {  <5> <6> <7> <8> <9> <10> <12> gen * cmr
    <10.95> cmr10
    <14.4>  cmr12
    <17.28><20.74><24.88>cmr17}{}
\end{lstlisting}
%
which says for instance that no font is available at 10.5\,pt (\LaTeX\ %
will substitute the nearest available size if you ask for this)
and similarly the font is not available at all above 25\,pt.

Such restrictions are essential with bitmap fonts to save generating
huge numbers of bitmaps for any size that might be requested, however
with scalable versions of the fonts these restrictions are not really 
needed. For instance the equivalent definition defined here is:
%
\begin{lstlisting}
\DeclareFontShape{OT1}{cmr}{m}{n}{
        <-6>    cmr5
        <6-7>   cmr6
        <7-8>   cmr7
        <8-9>   cmr8
        <9-10>  cmr9
        <10-12> cmr10
        <12-17> cmr12
        <17->   cmr17
      }{}
\end{lstlisting}
%
which means that you can (Although some may consider it bad style)
go
%
\begin{verbatim}
\fontsize{10.7pt}{12pt}\selectfont
\end{verbatim}
%
and be given a suitably scaled
version of \texttt{cmr10} and a baseline setting of 12\,pt. Similarly if you really
want, you can go
%
\begin{verbatim}
\fontsize{2cm}{2.5cm}\selectfont
\end{verbatim}
%
and use \texttt{cmr17} scaled
to 2\,cm height for a special display context.

\begin{flushleft}
  \begin{tikzpicture}
    \node[draw=black, inner sep=2ex] (frame) {%
      \parbox{\dimexpr\linewidth-4ex-1pt\relax}{%
        If you use this setup and produce \textsc{dvi} files using these sizes, be very
        careful if you give the \textsc{dvi} files so created to someone using classical
        bitmap versions of the cm fonts. Depending on how their system is set up
        they will either not be able to print the file at all, as they will not
        have the fonts at the corrrect sizes, or the system will make all these
        strange sizes `on demand' and fill the disk with bitmaps.
      }%
    };
    \node[fill=white] at (frame.north) {\textbf{Warning}};
  \end{tikzpicture}
\end{flushleft}

So the default way of using this package is as a \LaTeX\ package file.
Install \texttt{type1cm.sty} as described below and then just add
%
\begin{verbatim}
\usepackage{type1cm}
\end{verbatim}
%
to your document. This will override the definitions for all the fonts
and so the standard \textsc{fd} files are not used.
The disadvantage of this method is all the definitions are then loaded
into memory, even for fonts you don't use in the document. (However
only the size specifications are so loaded, not the fonts themselves).
However the advantage is that you can always choose not to specify 
\verb|\usepackage{type1cm}| and so use the same font sizes (and get the
same line and page breaks) as everyone else.

Alternatively you may use this package to produce a set of fd
files that \emph{replace} the standard files (such as \texttt{ot1cmr.fd})
You will then need to remake the \LaTeX\ format by running \texttt{initex} on
\texttt{latex.ltx} (as some \textsc{fd} files are loaded into the format). Then you
will not need to use \cmd{\usepackage}. All your documents will have the
freedom of scalable font choices.


\section{Installation instructions}

\renewcommand*{\labelenumi}{\theenumi)}

The installation is controlled by the file \texttt{type1cm.ins} which you may
edit in two places.
%
\begin{enumerate}
\item If you have not got the \AmS\ Font set available in scalable form
  remove the `\verb|%|' from the line \verb|%\def\ams{}|\\
  This will cause a more restricted font specification to be used.

  If you have an extended \AmS\ font set available in scalable form
  (\textsf{msam6}, \textsf{msam8} and \texttt{msam9} in addition to \textsf{msam5}, \textsf{msam7} and \textsf{msam10})
  then remove the `\verb|%|' from the line \verb|%\def\ams{ams,extra}|

\item If after reading the warning above you decide to make a set of fd 
  files, remove the `\verb|%|' from the line \verb|%\makefdtrue|
\end{enumerate}

Then run \texttt{tex} (or \texttt{latex}) on the file \texttt{type1cm.ins} and a package file
\texttt{type1cm.sty} (and perhaps a set of \textsc{fd} files) will be produced
which you should place in a directory where \TeX\ looks for input files.


\section{Small technical note about the Font Shape specifications used.}

I consistantly specified that given a requested size, the largest
available font size smaller than the requested size should be used
and then enlarged to the requested size. The exception being sizes
smaller than the smallest available font, which use a reduced version
of that font. The rationale for this is that enlarging a small font
typically produces a rather `fat' font, but something readable, whereas
shrinking a font may produce something unreadable quite quickly

So for \textsf{msam} (if `\opt{extra}' is not specified) I used:
%
\begin{lstlisting}
\DeclareFontShape{U}{msa}{m}{n}{
        <-7>    msam5 
        <7-10>  msam7
        <10->   msam10
        }{}
\end{lstlisting}
%
That is sizes strictly below 7\,pt use \textsf{msam5}, 7\,pt to (less than) 10\,pt
use \textsf{msam7} and sizes 10\,pt and above use \textsf{msam10}.

This differs from the Specification that the \AmS\ use for the scalable
\AmS\ fonts (used by the \opt{psfonts} option to the \pkg{amsfonts} package)
They use
%
\begin{lstlisting}
\DeclareFontShape{U}{msa}{m}{n}{
       <-6>      msam5 
       <6-8>     msam7 
       <8->      msam10
  }{}
\end{lstlisting}
%
This has the advantage of minimising the scaling used, so for instance
a 9\,pt request is satisfied by \textsf{msam7} scaled up to~9 by this package, but
by \textsf{msam10} scaled down to~9 by the \AmS\ package.

In practice this is not likely to make a difference that anyone notices,
but it could in principle affect line breaks etc, so I thought that
I would mention it here.

\clearpage


\section{History}

\begin{description}
\item[1997/01/27 v0.02 BlueSky/Y\&Y Type1 CM font definitions (DPC)] \leavevmode \\
  Possibly first public release? Maybe there was a 0.01..

\item[2002/04/01 v0.03 BlueSky/Y\&Y Type1 CM font definitions (DPC)] \leavevmode \\
  \textsf{cmdunhill} hasn't worked since the beginning: \cmd{\hyp\clap{\raisebox{-1.9ex}{\rmfamily\textuparrow}}enchar}

  Reported by Brian Mays via the Debian bug tracking system.
  Also, made distribution conditions LPPL (previously unspecified)
\end{description}

\end{document}