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}
27 % \MaintainedByLaTeXTeam{tools}
33 %% {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
34 %% 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
35 %% Digits \0\1\2\3\4\5\6\7\8\9
36 %% Exclamation \! Double quote \" Hash (number) \#
37 %% Dollar \$ Percent \% Ampersand \&
38 %% Acute accent \' Left paren \( Right paren \)
39 %% Asterisk \* Plus \+ Comma \,
40 %% Minus \- Point \. Solidus \/
41 %% Colon \: Semicolon \; Less than \<
42 %% Equals \= Greater than \> Question mark \?
43 %% Commercial at \@ Left bracket \[ Backslash \\
44 %% Right bracket \] Circumflex \^ Underscore \_
45 %% Grave accent \` Left brace \{ Vertical bar \|
46 %% Right brace \} Tilde \~}
49 % \changes{v0.01}{1994/05/01}{Created this test document as part of
51 % \changes{v0.02}{1994/05/12}{Added the t1enc and ot1enc packages.}
52 % \changes{v0.03}{1994/05/14}{Moved fontsmpl to its own dtx file.}
53 % \changes{v0.03}{1994/05/14}{Removed the t1enc and ot1enc packages.}
54 % \changes{v0.04}{1994/05/14}{Removed some debugging code, improved
56 % \changes{v0.05}{1994/05/14}{Tidied up some more. Removed the fontenc
58 % \changes{v0.06}{1994/10/27}{Added testing for all the commands in
60 % \changes{v0.06}{1994/10/27}{Switched off error for `commands not
61 % defined in this encoding'.}
62 % \changes{v0.07}{1994/10/29}{Added testing for \cs{dots},
63 % \cs{copyright} and \cs{textregistered}.}
64 % \changes{v0.07}{1994/10/29}{Replaced ??? for missing characters by
66 % \changes{v0.08}{1994/10/30}{Added testing for \cs{k} and \cs{t}.}
67 % \changes{v0.08}{1994/10/30}{Removed testing for any glyphs not in
69 % \changes{v0.08}{1994/10/30}{Allowed overfull boxes in the accent test
70 % to extend out into the right margin.}
71 % \changes{v0.10}{1995/09/19}{Corrected placement of docstrip guard.}
72 % \changes{v0.11}{1997/05/13}{Replaced \cs{@changed@x@err} by
73 % \cs{TextSymbolUnavailable}, according to the change in
74 % \texttt{ltoutenc.dtx}.}
76 % \section{Introduction}
78 % This document describes the font test document |fontsmpl.tex| and the
79 % accompanying package |fontsmpl.sty|. This produces a test of a font
80 % family, printing a sample text, a table of accents, and a sample of
81 % commands such as |\pounds|.
83 % It can be used in two ways. The |fontsmpl| package provides the
84 % command |\fontsample|, which produces a sample of the current font.
86 % The |fontsmpl| document prompts interactively for a font family (for
87 % example `|cmr|') and produces a sample of that family.
91 % \section{Documentation}
93 % This docstrip document has three docstrip options:
95 % \item |document| the code for |fontsmpl.tex|.
96 % \item |package| the code for |fontsmpl.sty|.
97 % \item |driver| this documentation.
99 % The code for the driver is:
102 \NeedsTeXFormat{LaTeX2e}
103 \documentclass{ltxdoc}
105 \DocInput{fontsmpl.dtx}
110 % \section{Font sample document}
112 % The sample document prompts for a family, and uses the |fontsmpl|
113 % package. If there is a file |fontsmpl.cfg|, this is loaded.
114 % \changes{v0.9}{1995/05/07}{Removed \cs{pagestyle} empty}
117 \NeedsTeXFormat{LaTeX2e}
118 \documentclass{article}
119 \usepackage{fontsmpl}
121 \InputIfFileExists{fontsmpl.cfg}{}{}
123 \typein[\family]{Please enter a family name (for example `cmr').}
124 \title{Test of \LaTeX{} font family `\family'}
125 \author{Font sample produced with `fontsmpl'}
129 \fontfamily{\family}\selectfont
130 \fontencoding{T1}\selectfont\fontsample
131 \fontencoding{OT1}\selectfont\fontsample
133 \fontencoding{T1}\selectfont\fontsample
134 \fontencoding{OT1}\selectfont\fontsample
136 \fontencoding{T1}\selectfont\fontsample
137 \fontencoding{OT1}\selectfont\fontsample
139 \fontencoding{T1}\selectfont\fontsample
140 \fontencoding{OT1}\selectfont\fontsample
142 \fontencoding{T1}\selectfont\fontsample
143 \fontencoding{OT1}\selectfont\fontsample
145 \fontencoding{T1}\selectfont\fontsample
146 \fontencoding{OT1}\selectfont\fontsample
148 \fontencoding{T1}\selectfont\fontsample
149 \fontencoding{OT1}\selectfont\fontsample
151 \fontencoding{T1}\selectfont\fontsample
152 \fontencoding{OT1}\selectfont\fontsample
157 % \section{Font sample package}
159 % The |fontsmpl| package is a \LaTeXe{} package.
162 \NeedsTeXFormat{LaTeX2e}
163 \ProvidesPackage{fontsmpl}[1994/10/29 Font sample package]
166 % \begin{macro}{\fontsample}
167 % The |\fontsample| command prints out a sample text, a
168 % selection of glyphs, and a table of accents.
170 \newcommand{\fontsample}{%
171 Test of font \f@encoding/\f@family/\f@series/\f@shape.
179 % \begin{macro}{\fontsampletext}
180 % A sample text, taken from Knuth's |testfont.tex|.
182 \newcommand{\fontsampletext}{%
184 \begin{quote}\begin{flushleft}
185 On November 14, 1885, Senator \& Mrs.~Leland Stanford called
186 together at their San Francisco mansion the 24~prominent men who
187 had been chosen as the first trustees of The Leland Stanford
188 Junior University. They handed to the board the Founding Grant
189 of the University, which they had executed three days before.
190 This document---with various amendments, legislative acts, and
191 court decrees---remains as the University's charter. In bold,
192 sweeping language it stipulates that the objectives of the
193 University are ``to qualify students for personal success and
194 direct usefulness in life; and to promote the publick welfare by
195 exercising an influence in behalf of humanity and civilization,
196 teaching the blessings of liberty regulated by law, and
197 inculcating love and reverence for the great principles of
198 government as derived from the inalienable rights of man to life,
199 liberty, and the pursuit of happiness.''
201 (!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)
203 ?`But aren't Kafka's Schlo\ss\
204 and \AE sop's \OE uvres often na\"\i ve vis-\`a-vis the
205 d\ae monic ph\oe nix's official r\^ole in fluffy s\t ouffl\'es?
208 \end{flushleft}\end{quote}
213 % \begin{macro}{\fontsampleglyphs}
214 % \begin{macro}{\fontsampleglyph}
215 % A list of sample glyph commands.
217 \newcommand{\fontsampleglyphs}{%
219 \begin{quote}\begin{flushleft}
224 \fontsampleglyph{\AA}
225 \fontsampleglyph{\AE}
226 \fontsampleglyph{\DH}
227 \fontsampleglyph{\DJ}
229 \fontsampleglyph{\NG}
230 \fontsampleglyph{\OE}
233 \fontsampleglyph{\SS}
235 \fontsampleglyph{\TH}
237 \fontsampleglyph{\aa}
238 \fontsampleglyph{\ae}
239 \fontsampleglyph{\copyright}
240 \fontsampleglyph{\dag}
241 \fontsampleglyph{\ddag}
242 \fontsampleglyph{\dh}
243 \fontsampleglyph{\dj}
244 \fontsampleglyph{\dots}
245 \fontsampleglyph{\guillemotleft}
246 \fontsampleglyph{\guillemotright}
247 \fontsampleglyph{\guilsinglleft}
248 \fontsampleglyph{\guilsinglright}
252 \fontsampleglyph{\ng}
253 \fontsampleglyph{\oe}
255 \fontsampleglyph{\pounds}
256 \fontsampleglyph{\quotedblbase}
257 \fontsampleglyph{\quotesinglbase}
258 \fontsampleglyph{\ss}
259 \fontsampleglyph{\textasciicircum}
260 \fontsampleglyph{\textasciitilde}
261 \fontsampleglyph{\textbackslash}
262 \fontsampleglyph{\textbar}
263 \fontsampleglyph{\textbullet}
264 \fontsampleglyph{\textcompwordmark}
265 \fontsampleglyph{\textemdash}
266 \fontsampleglyph{\textendash}
267 \fontsampleglyph{\textexclamdown}
268 \fontsampleglyph{\textgreater}
269 \fontsampleglyph{\texthyphenchar}
270 \fontsampleglyph{\textless}
271 \fontsampleglyph{\textperiodcentered}
272 \fontsampleglyph{\textquestiondown}
273 \fontsampleglyph{\textquotedblleft}
274 \fontsampleglyph{\textquotedblright}
275 \fontsampleglyph{\textquotedbl}
276 \fontsampleglyph{\textquoteleft}
277 \fontsampleglyph{\textquoteright}
278 \fontsampleglyph{\textvisiblespace}
279 \fontsampleglyph{\th}
282 \end{flushleft}\end{quote}
284 \newcommand{\fontsampleglyph}[1]{%
286 {\typewriterfont\string#1}~is~undefined
288 {\typewriterfont\string#1}~is~`#1'
295 % \begin{macro}{\fontsampleaccents}
296 % \begin{macro}{\fontsampleaccent}
297 % A sample of accents.
299 \newcommand{\fontsampleaccents}{%
301 \begin{quote}\begin{flushleft}
302 \fontsampleaccent{\"} \\
303 \fontsampleaccent{\'} \\
304 \fontsampleaccent{\.} \\
305 \fontsampleaccent{\=} \\
306 \fontsampleaccent{\H} \\
307 \fontsampleaccent{\^} \\
308 \fontsampleaccent{\`} \\
309 \fontsampleaccent{\b} \\
310 \fontsampleaccent{\c} \\
311 \fontsampleaccent{\d} \\
312 \fontsampleaccent{\k} \\
313 \fontsampleaccent{\u} \\
314 \fontsampleaccent{\v} \\
315 \fontsampleaccent{\~}
316 \end{flushleft}\end{quote}
318 \newcommand{\fontsampleaccent}[1]{%
319 \makebox[1em][r]{\typewriterfont\string#1}
321 #1A#1C#1D#1E#1G#1I#1L#1N%
322 #1O#1R#1S#1T#1U#1Y#1Z%
323 #1a#1c#1d#1e#1g#1\i#1i#1l#1n%
324 #1o#1r#1s#1t#1u#1y#1z%
331 % \begin{macro}{\typewriterfont}
332 % Not all sites have the T1 typewriter fonts, so we set the
333 % typewriter font to be a fixed font.
335 \DeclareFixedFont{\typewriterfont}
336 {\encodingdefault}{\ttdefault}{\mddefault}{\updefault}{10}
340 % \begin{macro}{\TextSymbolUnavailable}
341 % Switch off the error message from missing glyphs.
343 \def\TextSymbolUnavailable#1{%
344 \textbf{?}\PackageInfo{fontsmpl}{%
345 Command \protect#1 undefined in encoding \f@encoding%