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 % \changes{v0.01}{1994/05/01}{Created this test document as part of
35 % \changes{v0.02}{1994/05/12}{Added the t1enc and ot1enc packages.}
36 % \changes{v0.03}{1994/05/14}{Moved fontsmpl to its own dtx file.}
37 % \changes{v0.03}{1994/05/14}{Removed the t1enc and ot1enc packages.}
38 % \changes{v0.04}{1994/05/14}{Removed some debugging code, improved
40 % \changes{v0.05}{1994/05/14}{Tidied up some more. Removed the fontenc
42 % \changes{v0.06}{1994/10/27}{Added testing for all the commands in
44 % \changes{v0.06}{1994/10/27}{Switched off error for `commands not
45 % defined in this encoding'.}
46 % \changes{v0.07}{1994/10/29}{Added testing for \cs{dots},
47 % \cs{copyright} and \cs{textregistered}.}
48 % \changes{v0.07}{1994/10/29}{Replaced ??? for missing characters by
50 % \changes{v0.08}{1994/10/30}{Added testing for \cs{k} and \cs{t}.}
51 % \changes{v0.08}{1994/10/30}{Removed testing for any glyphs not in
53 % \changes{v0.08}{1994/10/30}{Allowed overfull boxes in the accent test
54 % to extend out into the right margin.}
55 % \changes{v0.10}{1995/09/19}{Corrected placement of docstrip guard.}
56 % \changes{v0.11}{1997/05/13}{Replaced \cs{@changed@x@err} by
57 % \cs{TextSymbolUnavailable}, according to the change in
58 % \texttt{ltoutenc.dtx}.}
60 % \section{Introduction}
62 % This document describes the font test document |fontsmpl.tex| and the
63 % accompanying package |fontsmpl.sty|. This produces a test of a font
64 % family, printing a sample text, a table of accents, and a sample of
65 % commands such as |\pounds|.
67 % It can be used in two ways. The |fontsmpl| package provides the
68 % command |\fontsample|, which produces a sample of the current font.
70 % The |fontsmpl| document prompts interactively for a font family (for
71 % example `|cmr|') and produces a sample of that family.
75 % \section{Documentation}
77 % This docstrip document has three docstrip options:
79 % \item |document| the code for |fontsmpl.tex|.
80 % \item |package| the code for |fontsmpl.sty|.
81 % \item |driver| this documentation.
83 % The code for the driver is:
86 \NeedsTeXFormat{LaTeX2e}
87 \documentclass{ltxdoc}
89 \DocInput{fontsmpl.dtx}
94 % \section{Font sample document}
96 % The sample document prompts for a family, and uses the |fontsmpl|
97 % package. If there is a file |fontsmpl.cfg|, this is loaded.
98 % \changes{v0.9}{1995/05/07}{Removed \cs{pagestyle} empty}
101 \NeedsTeXFormat{LaTeX2e}
102 \documentclass{article}
103 \usepackage{fontsmpl}
105 \InputIfFileExists{fontsmpl.cfg}{}{}
107 \typein[\family]{Please enter a family name (for example `cmr').}
108 \title{Test of \LaTeX{} font family `\family'}
109 \author{Font sample produced with `fontsmpl'}
113 \fontfamily{\family}\selectfont
114 \fontencoding{T1}\selectfont\fontsample
115 \fontencoding{OT1}\selectfont\fontsample
117 \fontencoding{T1}\selectfont\fontsample
118 \fontencoding{OT1}\selectfont\fontsample
120 \fontencoding{T1}\selectfont\fontsample
121 \fontencoding{OT1}\selectfont\fontsample
123 \fontencoding{T1}\selectfont\fontsample
124 \fontencoding{OT1}\selectfont\fontsample
126 \fontencoding{T1}\selectfont\fontsample
127 \fontencoding{OT1}\selectfont\fontsample
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
141 % \section{Font sample package}
143 % The |fontsmpl| package is a \LaTeXe{} package.
146 \NeedsTeXFormat{LaTeX2e}
147 \ProvidesPackage{fontsmpl}[1994/10/29 Font sample package]
150 % \begin{macro}{\fontsample}
151 % The |\fontsample| command prints out a sample text, a
152 % selection of glyphs, and a table of accents.
154 \newcommand{\fontsample}{%
155 Test of font \f@encoding/\f@family/\f@series/\f@shape.
163 % \begin{macro}{\fontsampletext}
164 % A sample text, taken from Knuth's |testfont.tex|.
166 \newcommand{\fontsampletext}{%
168 \begin{quote}\begin{flushleft}
169 On November 14, 1885, Senator \& Mrs.~Leland Stanford called
170 together at their San Francisco mansion the 24~prominent men who
171 had been chosen as the first trustees of The Leland Stanford
172 Junior University. They handed to the board the Founding Grant
173 of the University, which they had executed three days before.
174 This document---with various amendments, legislative acts, and
175 court decrees---remains as the University's charter. In bold,
176 sweeping language it stipulates that the objectives of the
177 University are ``to qualify students for personal success and
178 direct usefulness in life; and to promote the publick welfare by
179 exercising an influence in behalf of humanity and civilization,
180 teaching the blessings of liberty regulated by law, and
181 inculcating love and reverence for the great principles of
182 government as derived from the inalienable rights of man to life,
183 liberty, and the pursuit of happiness.''
185 (!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)
187 ?`But aren't Kafka's Schlo\ss\
188 and \AE sop's \OE uvres often na\"\i ve vis-\`a-vis the
189 d\ae monic ph\oe nix's official r\^ole in fluffy s\t ouffl\'es?
192 \end{flushleft}\end{quote}
197 % \begin{macro}{\fontsampleglyphs}
198 % \begin{macro}{\fontsampleglyph}
199 % A list of sample glyph commands.
201 \newcommand{\fontsampleglyphs}{%
203 \begin{quote}\begin{flushleft}
208 \fontsampleglyph{\AA}
209 \fontsampleglyph{\AE}
210 \fontsampleglyph{\DH}
211 \fontsampleglyph{\DJ}
213 \fontsampleglyph{\NG}
214 \fontsampleglyph{\OE}
217 \fontsampleglyph{\SS}
219 \fontsampleglyph{\TH}
221 \fontsampleglyph{\aa}
222 \fontsampleglyph{\ae}
223 \fontsampleglyph{\copyright}
224 \fontsampleglyph{\dag}
225 \fontsampleglyph{\ddag}
226 \fontsampleglyph{\dh}
227 \fontsampleglyph{\dj}
228 \fontsampleglyph{\dots}
229 \fontsampleglyph{\guillemotleft}
230 \fontsampleglyph{\guillemotright}
231 \fontsampleglyph{\guilsinglleft}
232 \fontsampleglyph{\guilsinglright}
236 \fontsampleglyph{\ng}
237 \fontsampleglyph{\oe}
239 \fontsampleglyph{\pounds}
240 \fontsampleglyph{\quotedblbase}
241 \fontsampleglyph{\quotesinglbase}
242 \fontsampleglyph{\ss}
243 \fontsampleglyph{\textasciicircum}
244 \fontsampleglyph{\textasciitilde}
245 \fontsampleglyph{\textbackslash}
246 \fontsampleglyph{\textbar}
247 \fontsampleglyph{\textbullet}
248 \fontsampleglyph{\textcompwordmark}
249 \fontsampleglyph{\textemdash}
250 \fontsampleglyph{\textendash}
251 \fontsampleglyph{\textexclamdown}
252 \fontsampleglyph{\textgreater}
253 \fontsampleglyph{\texthyphenchar}
254 \fontsampleglyph{\textless}
255 \fontsampleglyph{\textperiodcentered}
256 \fontsampleglyph{\textquestiondown}
257 \fontsampleglyph{\textquotedblleft}
258 \fontsampleglyph{\textquotedblright}
259 \fontsampleglyph{\textquotedbl}
260 \fontsampleglyph{\textquoteleft}
261 \fontsampleglyph{\textquoteright}
262 \fontsampleglyph{\textvisiblespace}
263 \fontsampleglyph{\th}
266 \end{flushleft}\end{quote}
268 \newcommand{\fontsampleglyph}[1]{%
270 {\typewriterfont\string#1}~is~undefined
272 {\typewriterfont\string#1}~is~`#1'
279 % \begin{macro}{\fontsampleaccents}
280 % \begin{macro}{\fontsampleaccent}
281 % A sample of accents.
283 \newcommand{\fontsampleaccents}{%
285 \begin{quote}\begin{flushleft}
286 \fontsampleaccent{\"} \\
287 \fontsampleaccent{\'} \\
288 \fontsampleaccent{\.} \\
289 \fontsampleaccent{\=} \\
290 \fontsampleaccent{\H} \\
291 \fontsampleaccent{\^} \\
292 \fontsampleaccent{\`} \\
293 \fontsampleaccent{\b} \\
294 \fontsampleaccent{\c} \\
295 \fontsampleaccent{\d} \\
296 \fontsampleaccent{\k} \\
297 \fontsampleaccent{\u} \\
298 \fontsampleaccent{\v} \\
299 \fontsampleaccent{\~}
300 \end{flushleft}\end{quote}
302 \newcommand{\fontsampleaccent}[1]{%
303 \makebox[1em][r]{\typewriterfont\string#1}
305 #1A#1C#1D#1E#1G#1I#1L#1N%
306 #1O#1R#1S#1T#1U#1Y#1Z%
307 #1a#1c#1d#1e#1g#1\i#1i#1l#1n%
308 #1o#1r#1s#1t#1u#1y#1z%
315 % \begin{macro}{\typewriterfont}
316 % Not all sites have the T1 typewriter fonts, so we set the
317 % typewriter font to be a fixed font.
319 \DeclareFixedFont{\typewriterfont}
320 {\encodingdefault}{\ttdefault}{\mddefault}{\updefault}{10}
324 % \begin{macro}{\TextSymbolUnavailable}
325 % Switch off the error message from missing glyphs.
327 \def\TextSymbolUnavailable#1{%
328 \textbf{?}\PackageInfo{fontsmpl}{%
329 Command \protect#1 undefined in encoding \f@encoding%