Initial release of Maemo 5 port of gnuplot
[gnuplot] / docs / psdoc / ps_fontfile_doc.tex
1 \documentclass[a4paper,10pt]{article}
2 \usepackage[T1]{fontenc}
3 \usepackage{booktabs}
4 \usepackage{longtable}
5 \usepackage{graphicx}
6 \usepackage{array}
7 \usepackage{calc}
8 %\usepackage[width=18cm,height=24cm]{geometry}
9 \addtolength{\textwidth}{40mm}
10 \addtolength{\oddsidemargin}{-15mm}
11
12 \let\orgcaption\caption
13 \newlength\tmplength
14 \newcommand{\captionabove}{%
15   \setlength{\tmplength}{\abovecaptionskip}%
16   \setlength{\abovecaptionskip}{\belowcaptionskip}%
17   \setlength{\belowcaptionskip}{\tmplength}%
18   \orgcaption}
19
20 \font\cmmi=cmmi10
21 \font\cmr=cmr10
22 \font\cmti=cmti10
23 \font\cmtt=cmtt10
24 \font\cmu=cmu10
25 \font\cmsy=cmsy10
26 \font\cmex=cmex10
27 \font\cmss=cmss10
28 \font\cmff=cmff10
29 \font\cmtex=cmtex10
30 \font\lasy=lasy10
31
32 \newcount\rownum
33 \newcounter{dezcnt}
34
35 \def\dez#1#2#3\empty{\setcounter{dezcnt}{64*#1+8*#2+#3}\thedezcnt}
36
37 \newcommand*\row[1]{%
38   \global\let\zus=\empty
39   \ifnum#1=000
40     \gdef\zus{241}%
41   \else\ifnum#1=001
42     \gdef\zus{242}%
43   \else\ifnum#1=002
44     \gdef\zus{243}%
45   \else\ifnum#1=003
46     \gdef\zus{244}%
47   \else\ifnum#1=004
48     \gdef\zus{245}%
49   \else\ifnum#1=005
50     \gdef\zus{246}%
51   \else\ifnum#1=006
52     \gdef\zus{247}%
53   \else\ifnum#1=007
54     \gdef\zus{250}%
55   \else\ifnum#1=010
56     \gdef\zus{251}%
57   \else\ifnum#1=011
58     \gdef\zus{252}%
59   \else\ifnum#1=012
60     \gdef\zus{255}%
61   \else\ifnum#1=013
62     \gdef\zus{256}%
63   \else\ifnum#1=014
64     \gdef\zus{257}%
65   \else\ifnum#1=015
66     \gdef\zus{260}%
67   \else\ifnum#1=016
68     \gdef\zus{261}%
69   \else\ifnum#1=017
70     \gdef\zus{262}%
71   \else\ifnum#1=020
72     \gdef\zus{263}%
73   \else\ifnum#1=021
74     \gdef\zus{264}%
75   \else\ifnum#1=022
76     \gdef\zus{265}%
77   \else\ifnum#1=023
78     \gdef\zus{266}%
79   \else\ifnum#1=024
80     \gdef\zus{267}%
81   \else\ifnum#1=025
82     \gdef\zus{270}%
83   \else\ifnum#1=026
84     \gdef\zus{271}%
85   \else\ifnum#1=027
86     \gdef\zus{272}%
87   \else\ifnum#1=030
88     \gdef\zus{273}%
89   \else\ifnum#1=031
90     \gdef\zus{274}%
91   \else\ifnum#1=032
92     \gdef\zus{275}%
93   \else\ifnum#1=033
94     \gdef\zus{276}%
95   \else\ifnum#1=034
96     \gdef\zus{277}%
97   \else\ifnum#1=035
98     \gdef\zus{300}%
99   \else\ifnum#1=036
100     \gdef\zus{301}%
101   \else\ifnum#1=037
102     \gdef\zus{302}%
103   \else\ifnum#1=040
104     \gdef\zus{303}% and \200
105   \else\ifnum#1=177
106     \gdef\zus{304}%
107   \fi\fi\fi\fi\fi\fi\fi
108   \fi\fi\fi\fi\fi\fi\fi
109   \fi\fi\fi\fi\fi\fi\fi
110   \fi\fi\fi\fi\fi\fi\fi
111   \fi\fi\fi\fi\fi\fi
112   \textbackslash #1%
113   \ifx\zus\empty
114   \else
115     , \textbackslash\zus
116   \fi & 
117   {\cmr\char'#1} & 
118   {\cmti\char'#1} & 
119   {\cmtt\char'#1} & 
120   {\cmmi\char'#1} &
121   {\cmu\char'#1} &
122   {\cmss\char'#1} &
123   {\cmtex\char'#1} &
124   {\cmff\char'#1} &
125   {\cmsy\char'#1} &
126   {\lasy\char'#1} &
127   \ifodd\rownum \else\qquad\fi
128   \global\advance\rownum 1
129   {\raisebox{1.7ex}[0mm][1ex]{\cmex\char'#1}} &
130   \textbackslash #1%
131   \ifx\zus\empty
132   \else
133     , \textbackslash\zus
134   \fi & 
135   \expandafter\dez#1\empty
136   \ifx\zus\empty
137   \else
138     , \expandafter\dez\zus\empty
139   \fi \\
140 }
141
142 \begin{document}
143 \title{Using \TeX\ Fonts in the Gnuplot Postscript Terminal}
144 \author{Harald Harders, {\ttfamily h.harders@tu-bs.de}}
145 \date{2003-03-03}
146 \maketitle
147
148 \noindent
149 The Postscript terminal can embed Postscript Type\,1 fonts (with
150 extensions \verb|.pfa| and \verb|.pfb|) and TrueType fonts (extension
151 \verb|.ttf|)\footnote{If \texttt{.pfb} and \texttt{.ttf} fonts really
152   can be embedded depends on your gnuplot installation: It needs to be
153   able to handle pipes.} using the command
154 \begin{verbatim}
155 set terminal postscript fontfile '<filename>'
156 \end{verbatim}
157 The \verb|fontfile| option can be used multiple times.
158 See the sections \emph{set terminal postscript} and \emph{set
159   fontpath} in the Gnuplot documentation for further description.
160
161 The embedded font can be used by 
162 \begin{verbatim}
163 set terminal postscript '<fontname>' <size>
164 \end{verbatim}
165 or in postscript enhanced terminal as following example:
166 \begin{verbatim}
167 set xlabel '{/CMMI10 x}'
168 \end{verbatim}
169
170 Among other things, the font embedding is useful for generating plots
171 to be included in \LaTeX\ documents. 
172 For normal text, the \emph{cm-super} Postscript Type\,1 fonts are a
173 good choice. 
174 They are available from CTAN servers, e.g.
175 \begin{verbatim}
176 ftp://ftp.dante.de/tex-archive/fonts/ps-type1/cm-super/
177 \end{verbatim}
178 The normal upright font with serifes is defined in
179 \verb|sfrm1000.pfb|, and the font name is \verb|SFRM1000|\footnote{If you
180   have an old version of the cm-super font, prior 2001-10-14, the font
181   name is in lowercase letters: \texttt{sfrm1000}. You should update
182   to a new version.} (The \verb|1000| means that this font is designed
183 for 10\,pt).
184 Replace the \verb|rm| by \verb|it|, \verb|bx| or other combinations in
185 both the file name and the font name (here, in uppercase letters) in order 
186 to get other font shapes.
187 The encoding of these fonts is ordinary and thus is not described
188 here.
189 Table~\ref{tab:fontnames} shows some examples of fonts contained in
190 the cm-super font bundle.
191 %
192 \begin{table}
193   \centering
194   \captionabove{Some fonts in the cm-super font bundle (for a
195     designsize of 10\,pt)}%
196   \label{tab:fontnames}%
197   \begin{tabular}{>{\ttfamily}l>{\ttfamily}ll}
198     \toprule
199     \multicolumn{1}{l}{File name}&
200     \multicolumn{1}{l}{Full font name} &
201     Example \\
202     & \multicolumn{1}{l}{(all preceded by \texttt{Computer Modern})} & \\
203     \midrule
204     sfrm1000.pfb& Roman &
205     {\rmfamily\upshape Example} \\
206     sfbx1000.pfb& Bold Extended &
207     {\rmfamily\bfseries\upshape Example} \\
208     sfti1000.pfb& Italic &
209     {\rmfamily\itshape Example} \\
210     sfbi1000.pfb& Bold Extended Italic &
211     {\rmfamily\bfseries\itshape Example} \\
212     sfsl1000.pfb& Slanted &
213     {\rmfamily\slshape Example} \\
214     sfbl1000.pfb& Bold Extended Slanted &
215     {\rmfamily\bfseries\slshape Example} \\
216     sfcc1000.pfb& Caps and Small Caps &
217     {\rmfamily\bfseries\scshape Example} \\
218     \midrule
219     sfss1000.pfb& Sans Serif &
220     {\sffamily\upshape Example} \\
221     sfsi1000.pfb& Sans Serif Slanted &
222     {\sffamily\slshape Example} \\
223     sfsx1000.pfb& Sans Serif Bold Extended &
224     {\sffamily\bfseries\upshape Example} \\
225     sfso1000.pfb& Sans Serif Bold Extended Slanted &
226     {\sffamily\bfseries\slshape Example} \\
227     \midrule
228     sftt1000.pfb& Typewriter &
229     {\ttfamily\upshape Example} \\
230     sfit1000.pfb& Typewriter Italic &
231     {\ttfamily\itshape Example} \\
232     sfst1000.pfb& Typewriter Slanted &
233     {\ttfamily\slshape Example} \\
234     sftc1000.pfb& Typewriter Caps and Small Caps &
235     {\ttfamily\scshape Example} \\
236     \bottomrule
237   \end{tabular}
238 \end{table}
239
240 For mathematics the Type\,1 versions of the Computer Modern fonts are
241 useful.
242 They should be installed in most \TeX\ implementations and are also
243 available from CTAN servers, e.g.
244 \begin{verbatim}
245 ftp://ftp.dante.de/tex-archive/fonts/cm/ps-type1/bluesky/pfb/
246 \end{verbatim}
247 Here, the font name is the base of the file name in uppercase letters,
248 e.g.\ the file \verb|cmmi10.pfb| contains the font \verb|CMMI10|.
249 Since the encoding of these fonts is strange, a table containing all
250 characters for some fonts follows.
251 The font \verb|CMEX10| contains large symbols for mathematics. They
252 overlap sometimes in the table. Since the baseline of the
253 \verb|CMEX10| font is at the top of the signs, Gnuplot defines a font
254 \verb|CMEX10-Baseline| with a different baseline if \verb|CMEX10| is
255 embedded (normally by using \verb|fontfile 'cmex10.pfb'|.
256 In contrast to the other fonts, \verb|CMEX10| is only available in the
257 design size 10\,pt.
258
259 You can access all characters of the fonts by typing their octal code.
260 To get a $\heartsuit$ symbol, you may type:
261 \begin{verbatim}
262 set label '{/CMSY10 \176}' at graph 0.5,0.5
263 \end{verbatim}
264 Since characters with an octal number below \textbackslash 040 can't
265 be displayed by some postscript interpreters, these characters are
266 repeated in the Computer Modern Fonts with a larger code.
267 Thus, you should use the larger number, where two octal numbers are
268 given (e.g.\ \textbackslash 000, \textbackslash 241).
269 For example, you better use
270 \begin{verbatim}
271 set xlabel '{/CMR10 \242}'
272 \end{verbatim}
273 than
274 \begin{verbatim}
275 set xlabel '{/CMR10 \001}'
276 \end{verbatim}
277 to get an upright uppercase Delta $\Delta$. 
278
279 \begin{longtable}{lllllllllllllr}
280   \toprule
281   Oct& \rotatebox{90}{CMR10}& \rotatebox{90}{CMTI10}&
282   \rotatebox{90}{CMTT10}& \rotatebox{90}{CMMI10}&
283   \rotatebox{90}{CMU10}& \rotatebox{90}{CMSS10}&
284   \rotatebox{90}{CMTEX10}& \rotatebox{90}{CMFF10}&
285   \rotatebox{90}{CMSY10}& \rotatebox{90}{LASY10}&
286   \rotatebox{90}{CMEX10-Baseline}& Oct& Dec\\
287   \midrule
288   \endhead
289   \bottomrule
290   \endfoot
291   \row{000}\row{001}\row{002}\row{003}\row{004}\row{005}\row{006}\row{007}
292   \row{010}\row{011}\row{012}\row{013}\row{014}\row{015}\row{016}\row{017}
293   \row{020}\row{021}\row{022}\row{023}\row{024}\row{025}\row{026}\row{027}
294   \row{030}\row{031}\row{032}\row{033}\row{034}\row{035}\row{036}\row{037}
295   \row{040}\row{041}\row{042}\row{043}\row{044}\row{045}\row{046}\row{047}
296   \row{050}\row{051}\row{052}\row{053}\row{054}\row{055}\row{056}\row{057}
297   \row{060}\row{061}\row{062}\row{063}\row{064}\row{065}\row{066}\row{067}
298   \row{070}\row{071}\row{072}\row{073}\row{074}\row{075}\row{076}\row{077}
299   %
300   \row{100}\row{101}\row{102}\row{103}\row{104}\row{105}\row{106}\row{107}
301   \row{110}\row{111}\row{112}\row{113}\row{114}\row{115}\row{116}\row{117}
302   \row{120}\row{121}\row{122}\row{123}\row{124}\row{125}\row{126}\row{127}
303   \row{130}\row{131}\row{132}\row{133}\row{134}\row{135}\row{136}\row{137}
304   \row{140}\row{141}\row{142}\row{143}\row{144}\row{145}\row{146}\row{147}
305   \row{150}\row{151}\row{152}\row{153}\row{154}\row{155}\row{156}\row{157}
306   \row{160}\row{161}\row{162}\row{163}\row{164}\row{165}\row{166}\row{167}
307   \row{170}\row{171}\row{172}\row{173}\row{174}\row{175}\row{176}\row{177}
308   %
309 \end{longtable}
310
311 \end{document}