1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
5 % The LaTeX3 Project and any individual authors listed elsewhere
8 % This file is part of the Standard LaTeX `Tools Bundle'.
9 % -------------------------------------------------------
11 % It may be distributed and/or modified under the
12 % conditions of the LaTeX Project Public License, either version 1.3c
13 % of this license or (at your option) any later version.
14 % The latest version of this license is in
15 % http://www.latex-project.org/lppl.txt
16 % and version 1.3c or later is part of all distributions of LaTeX
17 % version 2005/12/01 or later.
19 % The list of all files belonging to the LaTeX `Tools Bundle' is
20 % given in the file `manifest.txt'.
23 % \title{A font sampler}
24 % \author{Alan Jeffrey}
32 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
33 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
34 %% Digits \0\1\2\3\4\5\6\7\8\9
35 %% Exclamation \! Double quote \" Hash (number) \#
36 %% Dollar \$ Percent \% Ampersand \&
37 %% Acute accent \' Left paren \( Right paren \)
38 %% Asterisk \* Plus \+ Comma \,
39 %% Minus \- Point \. Solidus \/
40 %% Colon \: Semicolon \; Less than \<
41 %% Equals \= Greater than \> Question mark \?
42 %% Commercial at \@ Left bracket \[ Backslash \\
43 %% Right bracket \] Circumflex \^ Underscore \_
44 %% Grave accent \` Left brace \{ Vertical bar \|
45 %% Right brace \} Tilde \~}
48 % \changes{v0.01}{1994/05/01}{Created this test document as part of
50 % \changes{v0.02}{1994/05/12}{Added the t1enc and ot1enc packages.}
51 % \changes{v0.03}{1994/05/14}{Moved fontsmpl to its own dtx file.}
52 % \changes{v0.03}{1994/05/14}{Removed the t1enc and ot1enc packages.}
53 % \changes{v0.04}{1994/05/14}{Removed some debugging code, improved
55 % \changes{v0.05}{1994/05/14}{Tidied up some more. Removed the fontenc
57 % \changes{v0.06}{1994/10/27}{Added testing for all the commands in
59 % \changes{v0.06}{1994/10/27}{Switched off error for `commands not
60 % defined in this encoding'.}
61 % \changes{v0.07}{1994/10/29}{Added testing for \cs{dots},
62 % \cs{copyright} and \cs{textregistered}.}
63 % \changes{v0.07}{1994/10/29}{Replaced ??? for missing characters by
65 % \changes{v0.08}{1994/10/30}{Added testing for \cs{k} and \cs{t}.}
66 % \changes{v0.08}{1994/10/30}{Removed testing for any glyphs not in
68 % \changes{v0.08}{1994/10/30}{Allowed overfull boxes in the accent test
69 % to extend out into the right margin.}
70 % \changes{v0.10}{1995/09/19}{Corrected placement of docstrip guard.}
71 % \changes{v0.11}{1997/05/13}{Replaced \cs{@changed@x@err} by
72 % \cs{TextSymbolUnavailable}, according to the change in
73 % \texttt{ltoutenc.dtx}.}
75 % \section{Introduction}
77 % This document describes the font test document |fontsmpl.tex| and the
78 % accompanying package |fontsmpl.sty|. This produces a test of a font
79 % family, printing a sample text, a table of accents, and a sample of
80 % commands such as |\pounds|.
82 % It can be used in two ways. The |fontsmpl| package provides the
83 % command |\fontsample|, which produces a sample of the current font.
85 % The |fontsmpl| document prompts interactively for a font family (for
86 % example `|cmr|') and produces a sample of that family.
90 % \section{Documentation}
92 % This docstrip document has three docstrip options:
94 % \item |document| the code for |fontsmpl.tex|.
95 % \item |package| the code for |fontsmpl.sty|.
96 % \item |driver| this documentation.
98 % The code for the driver is:
101 \NeedsTeXFormat{LaTeX2e}
102 \documentclass{ltxdoc}
104 \DocInput{fontsmpl.dtx}
109 % \section{Font sample document}
111 % The sample document prompts for a family, and uses the |fontsmpl|
112 % package. If there is a file |fontsmpl.cfg|, this is loaded.
113 % \changes{v0.9}{1995/05/07}{Removed \cs{pagestyle} empty}
116 \NeedsTeXFormat{LaTeX2e}
117 \documentclass{article}
118 \usepackage{fontsmpl}
120 \InputIfFileExists{fontsmpl.cfg}{}{}
122 \typein[\family]{Please enter a family name (for example `cmr').}
123 \title{Test of \LaTeX{} font family `\family'}
124 \author{Font sample produced with `fontsmpl'}
128 \fontfamily{\family}\selectfont
129 \fontencoding{T1}\selectfont\fontsample
130 \fontencoding{OT1}\selectfont\fontsample
132 \fontencoding{T1}\selectfont\fontsample
133 \fontencoding{OT1}\selectfont\fontsample
135 \fontencoding{T1}\selectfont\fontsample
136 \fontencoding{OT1}\selectfont\fontsample
138 \fontencoding{T1}\selectfont\fontsample
139 \fontencoding{OT1}\selectfont\fontsample
141 \fontencoding{T1}\selectfont\fontsample
142 \fontencoding{OT1}\selectfont\fontsample
144 \fontencoding{T1}\selectfont\fontsample
145 \fontencoding{OT1}\selectfont\fontsample
147 \fontencoding{T1}\selectfont\fontsample
148 \fontencoding{OT1}\selectfont\fontsample
150 \fontencoding{T1}\selectfont\fontsample
151 \fontencoding{OT1}\selectfont\fontsample
156 % \section{Font sample package}
158 % The |fontsmpl| package is a \LaTeXe{} package.
161 \NeedsTeXFormat{LaTeX2e}
162 \ProvidesPackage{fontsmpl}[1994/10/29 Font sample package]
165 % \begin{macro}{\fontsample}
166 % The |\fontsample| command prints out a sample text, a
167 % selection of glyphs, and a table of accents.
169 \newcommand{\fontsample}{%
170 Test of font \f@encoding/\f@family/\f@series/\f@shape.
178 % \begin{macro}{\fontsampletext}
179 % A sample text, taken from Knuth's |testfont.tex|.
181 \newcommand{\fontsampletext}{%
183 \begin{quote}\begin{flushleft}
184 On November 14, 1885, Senator \& Mrs.~Leland Stanford called
185 together at their San Francisco mansion the 24~prominent men who
186 had been chosen as the first trustees of The Leland Stanford
187 Junior University. They handed to the board the Founding Grant
188 of the University, which they had executed three days before.
189 This document---with various amendments, legislative acts, and
190 court decrees---remains as the University's charter. In bold,
191 sweeping language it stipulates that the objectives of the
192 University are ``to qualify students for personal success and
193 direct usefulness in life; and to promote the publick welfare by
194 exercising an influence in behalf of humanity and civilization,
195 teaching the blessings of liberty regulated by law, and
196 inculcating love and reverence for the great principles of
197 government as derived from the inalienable rights of man to life,
198 liberty, and the pursuit of happiness.''
200 (!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)
202 ?`But aren't Kafka's Schlo\ss\
203 and \AE sop's \OE uvres often na\"\i ve vis-\`a-vis the
204 d\ae monic ph\oe nix's official r\^ole in fluffy s\t ouffl\'es?
207 \end{flushleft}\end{quote}
212 % \begin{macro}{\fontsampleglyphs}
213 % \begin{macro}{\fontsampleglyph}
214 % A list of sample glyph commands.
216 \newcommand{\fontsampleglyphs}{%
218 \begin{quote}\begin{flushleft}
223 \fontsampleglyph{\AA}
224 \fontsampleglyph{\AE}
225 \fontsampleglyph{\DH}
226 \fontsampleglyph{\DJ}
228 \fontsampleglyph{\NG}
229 \fontsampleglyph{\OE}
232 \fontsampleglyph{\SS}
234 \fontsampleglyph{\TH}
236 \fontsampleglyph{\aa}
237 \fontsampleglyph{\ae}
238 \fontsampleglyph{\copyright}
239 \fontsampleglyph{\dag}
240 \fontsampleglyph{\ddag}
241 \fontsampleglyph{\dh}
242 \fontsampleglyph{\dj}
243 \fontsampleglyph{\dots}
244 \fontsampleglyph{\guillemotleft}
245 \fontsampleglyph{\guillemotright}
246 \fontsampleglyph{\guilsinglleft}
247 \fontsampleglyph{\guilsinglright}
251 \fontsampleglyph{\ng}
252 \fontsampleglyph{\oe}
254 \fontsampleglyph{\pounds}
255 \fontsampleglyph{\quotedblbase}
256 \fontsampleglyph{\quotesinglbase}
257 \fontsampleglyph{\ss}
258 \fontsampleglyph{\textasciicircum}
259 \fontsampleglyph{\textasciitilde}
260 \fontsampleglyph{\textbackslash}
261 \fontsampleglyph{\textbar}
262 \fontsampleglyph{\textbullet}
263 \fontsampleglyph{\textcompwordmark}
264 \fontsampleglyph{\textemdash}
265 \fontsampleglyph{\textendash}
266 \fontsampleglyph{\textexclamdown}
267 \fontsampleglyph{\textgreater}
268 \fontsampleglyph{\texthyphenchar}
269 \fontsampleglyph{\textless}
270 \fontsampleglyph{\textperiodcentered}
271 \fontsampleglyph{\textquestiondown}
272 \fontsampleglyph{\textquotedblleft}
273 \fontsampleglyph{\textquotedblright}
274 \fontsampleglyph{\textquotedbl}
275 \fontsampleglyph{\textquoteleft}
276 \fontsampleglyph{\textquoteright}
277 \fontsampleglyph{\textvisiblespace}
278 \fontsampleglyph{\th}
281 \end{flushleft}\end{quote}
283 \newcommand{\fontsampleglyph}[1]{%
285 {\typewriterfont\string#1}~is~undefined
287 {\typewriterfont\string#1}~is~`#1'
294 % \begin{macro}{\fontsampleaccents}
295 % \begin{macro}{\fontsampleaccent}
296 % A sample of accents.
298 \newcommand{\fontsampleaccents}{%
300 \begin{quote}\begin{flushleft}
301 \fontsampleaccent{\"} \\
302 \fontsampleaccent{\'} \\
303 \fontsampleaccent{\.} \\
304 \fontsampleaccent{\=} \\
305 \fontsampleaccent{\H} \\
306 \fontsampleaccent{\^} \\
307 \fontsampleaccent{\`} \\
308 \fontsampleaccent{\b} \\
309 \fontsampleaccent{\c} \\
310 \fontsampleaccent{\d} \\
311 \fontsampleaccent{\k} \\
312 \fontsampleaccent{\u} \\
313 \fontsampleaccent{\v} \\
314 \fontsampleaccent{\~}
315 \end{flushleft}\end{quote}
317 \newcommand{\fontsampleaccent}[1]{%
318 \makebox[1em][r]{\typewriterfont\string#1}
320 #1A#1C#1D#1E#1G#1I#1L#1N%
321 #1O#1R#1S#1T#1U#1Y#1Z%
322 #1a#1c#1d#1e#1g#1\i#1i#1l#1n%
323 #1o#1r#1s#1t#1u#1y#1z%
330 % \begin{macro}{\typewriterfont}
331 % Not all sites have the T1 typewriter fonts, so we set the
332 % typewriter font to be a fixed font.
334 \DeclareFixedFont{\typewriterfont}
335 {\encodingdefault}{\ttdefault}{\mddefault}{\updefault}{10}
339 % \begin{macro}{\TextSymbolUnavailable}
340 % Switch off the error message from missing glyphs.
342 \def\TextSymbolUnavailable#1{%
343 \textbf{?}\PackageInfo{fontsmpl}{%
344 Command \protect#1 undefined in encoding \f@encoding%