| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 1993-2025 |
| 4 |
% |
| 5 |
% The LaTeX Project and any individual authors listed elsewhere |
| 6 |
% in this file. |
| 7 |
% |
| 8 |
% This file is part of the Standard LaTeX `Tools Bundle'. |
| 9 |
% ------------------------------------------------------- |
| 10 |
% |
| 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 |
% https://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. |
| 18 |
% |
| 19 |
% The list of all files belonging to the LaTeX `Tools Bundle' is |
| 20 |
% given in the file `manifest.txt'. |
| 21 |
% |
| 22 |
% \fi |
| 23 |
% \title{A font sampler} |
| 24 |
% \author{Alan Jeffrey} |
| 25 |
% \date{v0.11} |
| 26 |
% |
| 27 |
% \MaintainedByLaTeXTeam{tools} |
| 28 |
% \maketitle |
| 29 |
% |
| 30 |
% |
| 31 |
%% |
| 32 |
% |
| 33 |
% \changes{v0.01}{1994/05/01}{Created this test document as part of |
| 34 |
% accents.dtx.} |
| 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 |
| 39 |
% documentation.} |
| 40 |
% \changes{v0.05}{1994/05/14}{Tidied up some more. Removed the fontenc |
| 41 |
% package.} |
| 42 |
% \changes{v0.06}{1994/10/27}{Added testing for all the commands in |
| 43 |
% ltoutenc.} |
| 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 |
| 49 |
% \textbf{?}.} |
| 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 |
| 52 |
% usrguide.} |
| 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}.} |
| 59 |
% |
| 60 |
% \section{Introduction} |
| 61 |
% |
| 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|. |
| 66 |
% |
| 67 |
% It can be used in two ways. The |fontsmpl| package provides the |
| 68 |
% command |\fontsample|, which produces a sample of the current font. |
| 69 |
% |
| 70 |
% The |fontsmpl| document prompts interactively for a font family (for |
| 71 |
% example `|cmr|') and produces a sample of that family. |
| 72 |
% |
| 73 |
% \MaybeStop{} |
| 74 |
% |
| 75 |
% \section{Documentation} |
| 76 |
% |
| 77 |
% This docstrip document has three docstrip options: |
| 78 |
% \begin{itemize} |
| 79 |
% \item |document| the code for |fontsmpl.tex|. |
| 80 |
% \item |package| the code for |fontsmpl.sty|. |
| 81 |
% \item |driver| this documentation. |
| 82 |
% \end{itemize} |
| 83 |
% The code for the driver is: |
| 84 |
% \begin{macrocode} |
| 85 |
%<*driver> |
| 86 |
\NeedsTeXFormat{LaTeX2e} |
| 87 |
\documentclass{ltxdoc} |
| 88 |
\begin{document} |
| 89 |
\DocInput{fontsmpl.dtx} |
| 90 |
\end{document} |
| 91 |
%</driver> |
| 92 |
% \end{macrocode} |
| 93 |
% |
| 94 |
% \section{Font sample document} |
| 95 |
% |
| 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} |
| 99 |
% \begin{macrocode} |
| 100 |
%<*document> |
| 101 |
\NeedsTeXFormat{LaTeX2e} |
| 102 |
\documentclass{article} |
| 103 |
\usepackage{fontsmpl} |
| 104 |
\makeatletter |
| 105 |
\InputIfFileExists{fontsmpl.cfg}{}{} |
| 106 |
\makeatother |
| 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'} |
| 110 |
\raggedright |
| 111 |
\begin{document} |
| 112 |
\maketitle |
| 113 |
\fontfamily{\family}\selectfont |
| 114 |
\fontencoding{T1}\selectfont\fontsample |
| 115 |
\fontencoding{OT1}\selectfont\fontsample |
| 116 |
\itshape |
| 117 |
\fontencoding{T1}\selectfont\fontsample |
| 118 |
\fontencoding{OT1}\selectfont\fontsample |
| 119 |
\slshape |
| 120 |
\fontencoding{T1}\selectfont\fontsample |
| 121 |
\fontencoding{OT1}\selectfont\fontsample |
| 122 |
\scshape |
| 123 |
\fontencoding{T1}\selectfont\fontsample |
| 124 |
\fontencoding{OT1}\selectfont\fontsample |
| 125 |
\upshape\bfseries |
| 126 |
\fontencoding{T1}\selectfont\fontsample |
| 127 |
\fontencoding{OT1}\selectfont\fontsample |
| 128 |
\itshape |
| 129 |
\fontencoding{T1}\selectfont\fontsample |
| 130 |
\fontencoding{OT1}\selectfont\fontsample |
| 131 |
\slshape |
| 132 |
\fontencoding{T1}\selectfont\fontsample |
| 133 |
\fontencoding{OT1}\selectfont\fontsample |
| 134 |
\scshape |
| 135 |
\fontencoding{T1}\selectfont\fontsample |
| 136 |
\fontencoding{OT1}\selectfont\fontsample |
| 137 |
\end{document} |
| 138 |
%</document> |
| 139 |
% \end{macrocode} |
| 140 |
% |
| 141 |
% \section{Font sample package} |
| 142 |
% |
| 143 |
% The |fontsmpl| package is a \LaTeXe{} package. |
| 144 |
% \begin{macrocode} |
| 145 |
%<*package> |
| 146 |
\NeedsTeXFormat{LaTeX2e} |
| 147 |
\ProvidesPackage{fontsmpl}[1994/10/29 Font sample package] |
| 148 |
% \end{macrocode} |
| 149 |
% |
| 150 |
% \begin{macro}{\fontsample} |
| 151 |
% The |\fontsample| command prints out a sample text, a |
| 152 |
% selection of glyphs, and a table of accents. |
| 153 |
% \begin{macrocode} |
| 154 |
\newcommand{\fontsample}{% |
| 155 |
Test of font \f@encoding/\f@family/\f@series/\f@shape. |
| 156 |
\fontsampletext |
| 157 |
\fontsampleglyphs |
| 158 |
\fontsampleaccents |
| 159 |
} |
| 160 |
% \end{macrocode} |
| 161 |
% \end{macro} |
| 162 |
% |
| 163 |
% \begin{macro}{\fontsampletext} |
| 164 |
% A sample text, taken from Knuth's |testfont.tex|. |
| 165 |
% \begin{macrocode} |
| 166 |
\newcommand{\fontsampletext}{% |
| 167 |
Some text: |
| 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.'' |
| 184 |
\\ |
| 185 |
(!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!) |
| 186 |
\\ |
| 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? |
| 190 |
\\ |
| 191 |
|
| 192 |
\end{flushleft}\end{quote} |
| 193 |
} |
| 194 |
% \end{macrocode} |
| 195 |
% \end{macro} |
| 196 |
% |
| 197 |
% \begin{macro}{\fontsampleglyphs} |
| 198 |
% \begin{macro}{\fontsampleglyph} |
| 199 |
% A list of sample glyph commands. |
| 200 |
% \begin{macrocode} |
| 201 |
\newcommand{\fontsampleglyphs}{% |
| 202 |
Some glyphs: |
| 203 |
\begin{quote}\begin{flushleft} |
| 204 |
\fontsampleglyph{\#} |
| 205 |
\fontsampleglyph{\$} |
| 206 |
\fontsampleglyph{\%} |
| 207 |
\fontsampleglyph{\&} |
| 208 |
\fontsampleglyph{\AA} |
| 209 |
\fontsampleglyph{\AE} |
| 210 |
\fontsampleglyph{\DH} |
| 211 |
\fontsampleglyph{\DJ} |
| 212 |
\fontsampleglyph{\L} |
| 213 |
\fontsampleglyph{\NG} |
| 214 |
\fontsampleglyph{\OE} |
| 215 |
\fontsampleglyph{\O} |
| 216 |
\fontsampleglyph{\P} |
| 217 |
\fontsampleglyph{\SS} |
| 218 |
\fontsampleglyph{\S} |
| 219 |
\fontsampleglyph{\TH} |
| 220 |
\fontsampleglyph{\_} |
| 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} |
| 233 |
\fontsampleglyph{\i} |
| 234 |
\fontsampleglyph{\j} |
| 235 |
\fontsampleglyph{\l} |
| 236 |
\fontsampleglyph{\ng} |
| 237 |
\fontsampleglyph{\oe} |
| 238 |
\fontsampleglyph{\o} |
| 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} |
| 264 |
\fontsampleglyph{\{} |
| 265 |
\fontsampleglyph{\}} |
| 266 |
\end{flushleft}\end{quote} |
| 267 |
} |
| 268 |
\newcommand{\fontsampleglyph}[1]{% |
| 269 |
\ifx#1\@undefined |
| 270 |
{\typewriterfont\string#1}~is~undefined |
| 271 |
\else |
| 272 |
{\typewriterfont\string#1}~is~`#1' |
| 273 |
\fi |
| 274 |
} |
| 275 |
% \end{macrocode} |
| 276 |
% \end{macro} |
| 277 |
% \end{macro} |
| 278 |
% |
| 279 |
% \begin{macro}{\fontsampleaccents} |
| 280 |
% \begin{macro}{\fontsampleaccent} |
| 281 |
% A sample of accents. |
| 282 |
% \begin{macrocode} |
| 283 |
\newcommand{\fontsampleaccents}{% |
| 284 |
Some accents: |
| 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} |
| 301 |
} |
| 302 |
\newcommand{\fontsampleaccent}[1]{% |
| 303 |
\makebox[1em][r]{\typewriterfont\string#1} |
| 304 |
\makebox[15em][l]{% |
| 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% |
| 309 |
} |
| 310 |
} |
| 311 |
% \end{macrocode} |
| 312 |
% \end{macro} |
| 313 |
% \end{macro} |
| 314 |
% |
| 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. |
| 318 |
% \begin{macrocode} |
| 319 |
\DeclareFixedFont{\typewriterfont} |
| 320 |
{\encodingdefault}{\ttdefault}{\mddefault}{\updefault}{10} |
| 321 |
% \end{macrocode} |
| 322 |
% \end{macro} |
| 323 |
% |
| 324 |
% \begin{macro}{\TextSymbolUnavailable} |
| 325 |
% Switch off the error message from missing glyphs. |
| 326 |
% \begin{macrocode} |
| 327 |
\def\TextSymbolUnavailable#1{% |
| 328 |
\textbf{?}\PackageInfo{fontsmpl}{% |
| 329 |
Command \protect#1 undefined in encoding \f@encoding% |
| 330 |
}% |
| 331 |
} |
| 332 |
%</package> |
| 333 |
% \end{macrocode} |
| 334 |
% \end{macro} |
| 335 |
%\Finale |
| 336 |
\endinput |
| 337 |
|
| 338 |
|