summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fonttable
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-16 18:56:46 +0000
committerKarl Berry <karl@freefriends.org>2009-05-16 18:56:46 +0000
commita8faed6991f5b2ac497fcd32cb600b32fe0763e1 (patch)
treec6ba11ed42282d7b12606d4e405e83a323d84626 /Master/texmf-dist/source/latex/fonttable
parent64af07dd2e1f98360294c12eab5db723fccb13b4 (diff)
fonttable 1.5 (14may09)
git-svn-id: svn://tug.org/texlive/trunk@13126 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fonttable')
-rw-r--r--Master/texmf-dist/source/latex/fonttable/fonttable.dtx322
1 files changed, 309 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/latex/fonttable/fonttable.dtx b/Master/texmf-dist/source/latex/fonttable/fonttable.dtx
index 60d50113134..480564381ad 100644
--- a/Master/texmf-dist/source/latex/fonttable/fonttable.dtx
+++ b/Master/texmf-dist/source/latex/fonttable/fonttable.dtx
@@ -55,7 +55,7 @@
%
% \fi
%
-% \CheckSum{659}
+% \CheckSum{913}
%
% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
% \DoNotIndex{\@centercr,\@cite}
@@ -104,6 +104,8 @@
% \changes{v1.2}{2006/10/02}{Minor extensions of texts}
% \changes{v1.3}{2009/04/30}{Fix serious bug}
% \changes{v1.4}{2009/05/06}{Added another way to select a font}
+% \changes{v1.5}{2009/05/12}{Added code for Knuth's testfont.tex}
+% \changes{v1.51}{2009/05/14}{Eliminated a clash with babel package}
%
% \def\fileversion{v1.0} \def\filedate{2005/11/27}
% \def\fileversion{v1.0a} \def\filedate{2005/12/06}
@@ -111,6 +113,8 @@
% \def\fileversion{v1.2} \def\filedate{2008/05/08}
% \def\fileversion{v1.3} \def\filedate{2009/04/30}
% \def\fileversion{v1.4} \def\filedate{2009/05/06}
+% \def\fileversion{v1.5} \def\filedate{2009/05/12}
+% \def\fileversion{v1.51} \def\filedate{2009/05/14}
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
@@ -148,7 +152,17 @@
% \section{The package}
%
% The package provides commands to typeset a table of all the glyphs in
-% a given font and to typeset an example of regular text.
+% a given font and to typeset an example of regular text. For font designers
+% it provides commands to typeset a `test' glyph among sets of glyphs
+% from the font.
+%
+% \DescribeMacro{\fnthours}
+% As a convenience, \cs{fnthours} prints the time of day when the file was
+% processed; it uses the 24 hour clock notation. (The macro \cs{today} prints
+% the date when the file was processed.)
+%
+% \subsection{Table and texts}
+%
%
% \DescribeMacro{\fonttable}
% The command \\
@@ -159,6 +173,21 @@
% like \texttt{cmr10} (for Computer Modern Roman) or \texttt{pzdr}
% (for Zapf Dingbats).
%
+% NOTE: The \Lpack{mftinc} package~\cite{MFTINC} for pretty-printing
+% METAFONT code also defines a \cs{fonttable} macro that is akin to this
+% one. If you want to use both packages together then you can use the following
+% general procedure for when a macro \cs{macro} is defined in both
+% \Lpack{packA} and \Lpack{packB} packages.
+% \begin{verbatim}
+% \usepackage{packA}
+% \let\macroA\macro% save packA's definition
+% \let\macro\relax% undefine \macro
+% \usepackage{packB}% now it's packB's definition of \macro
+% ...
+% \macro % use the packB defintion
+% \macroA % use the packA definition
+% \end{verbatim}
+%
% \DescribeMacro{\xfonttable}
% The command \\
% \cs{xfonttable}\marg{encoding}\marg{family}\marg{series}\marg{shape} \\
@@ -263,14 +292,19 @@
% using \meta{fontspec} (e.g., \verb?\rmfamily\itshape? or
% \verb?\pikfont{T1}{ppl}{m}{it}?).
%
-% \DescribeMacro{\germantext}
-% \DescribeMacro{\latintext}
-% \cs{germantext} expands to German language paragraph, borrowed from the
+% \DescribeMacro{\germanparatext}
+% \DescribeMacro{\latinparatext}
+% \cs{germanparatext} expands to a German language paragraph, borrowed from the
% \Lpack{blindtext} package~\cite{BLINDTEXT}.
-% \cs{latintext} expands to one version of
+% \cs{latinparatext} expands to one version of
% a paragraph of the traditional \textit{lorem ipsum} dummy Latin text.
% Either, or both, of these could be used as the \meta{text} argument
-% to \cs{fonttexts} or \cs{regulartexts}.
+% to \cs{fonttexts} or \cs{regulartexts}. \\
+% NOTE: These were originally called \cs{germantext} and \cs{latintext}
+% but on 2009/05/14 I was told that the \Lpack{babel} package defines \cs{latintext},
+% which causes unexpected results if it is used in the same document as this
+% package. To try and be on the safe side I renamed \cs{germantext}
+% as well as \cs{latintext}.
%
% \DescribeMacro{\aztext}
% \DescribeMacro{\AZtext}
@@ -282,6 +316,81 @@
% digits 0 to 9, and to the typical punctuation marks. In all cases there
% is a space between each character.
%
+% \subsection{Testing a glyph}
+%
+% The macros here are a reimplementation of Donald Knuth's
+% \texttt{testfont.tex}, which is available from CTAN.
+%
+% In the following, the value of a glyph argument can be specified as
+% its location in the font (i.e., as a decimal number). With a few exceptions,
+% if the glyph is within the visible ASCII range (33--126) it may instead be
+% specified by the ASCII character prefixed with a single open quote
+% mark\footnote{Sometimes called a
+% `backquote'.} (`). The exceptions are nos: 37 (\verb?%?), 92 (\verb?\?)
+% 123 (\verb?{?) and 125 (\verb?}?) (but there may be others).
+% In any case, the glyph representing the
+% character \texttt{p} can be specified either as \texttt{`p} or as
+% \texttt{112}.
+%
+% The glyphs are taken from the current font. If the font does not
+% have Latin alphabet glyphs in the ASCII locations then
+% in the descriptions below phrases like `lowercase alphabet' or `uppercase
+% alphabet' or `digits', should be taken to mean (the glyphs in) those
+% locations.
+%
+% \DescribeMacro{\glyphmixture}
+% \cs{glyphmixture}\marg{T}\marg{S}\marg{E} typesets the \meta{T} (test) glyph
+% between the glyphs in the range from \meta{S} (start) to \meta{E} (end).
+% For example \\
+% \verb?\glyphmixture{`e}{`f}{`g}? will produce \\
+% \texttt{efeeffeeefffef} \\
+% \texttt{egeeggeeegggeg}
+%
+% \DescribeMacro{\glyphalternation}
+% \cs{glyphalternation}\marg{T}\marg{S}\marg{E} typesets the \meta{T}
+% glyph alternately between each glyph in the range from \meta{S}
+% to \meta{E}.
+% For example \\
+% \verb?\glyphalternation{`e}{`f}{`g}? will produce \\
+% \texttt{efefefefefefefefe} \\
+% \texttt{egegegegegegegege}
+%
+% \DescribeMacro{\glyphseries}
+% \cs{glyphseries}\marg{T}\marg{S}\marg{E} typesets the \meta{T}
+% glyph between the glyphs in the range from \meta{S}
+% to \meta{E}.
+% For example \\
+% \verb?\glyphseries{`e}{`f}{`h}? will produce \\
+% \texttt{efegehe}
+%
+% \DescribeMacro{\glyphalphabet}
+% \DescribeMacro{\GLYPHALPHABET}
+% \cs{glyphalphabet}\marg{T} typesets the \meta{T} glyph between
+% each letter of the lowercase Latin alphabet plus a few others.
+% \cs{GLYPHALPHABET}\marg{T}
+% does the same but using the uppercase Latin alphabet.
+% For example, the output of \\
+% \verb?\glyphalphabet}{`3}? is like \\
+% \texttt{3a3b3c3d3e3f3g\ldots3z3\char31 3}\verb?~?\texttt{3\char33 3\char34 3}
+%
+% \DescribeMacro{\glyphlowers}
+% \DescribeMacro{\glyphlowers}
+% \DescribeMacro{\glyphdigits}
+% \cs{glyphlowers} takes each character of the lowercase alphabet in turn as
+% a test glyph and sets it interpersed among the other lowercase characters.
+% \cs{glyphuppers} and \cs{glyphdigits} are similar except that they use
+% the uppercase alphabet and the ten digits instead. For example,
+% \cs{glyphdigits} produces output like \\
+% \texttt{000102030405060708090} \\
+% \texttt{101112131415161718191} \\
+% \texttt{202122232425262728292} \\
+% \ldots \\
+% \texttt{909192939495969798999}
+%
+% \DescribeMacro{\glyphpunct}
+% \cs{glyphpunct} sets a collection of words with an assortment of
+% punctuation marks.
+%
%
% \StopEventually{
% \bibliographystyle{alpha}
@@ -302,6 +411,12 @@
% \newblock Second edition.
% \newblock Addison-Wesley Publishing Company, 2004.
%
+% \bibitem[Pak05]{MFTINC}
+% Scott Pakin
+% \newblock `The \Lpack{mftinc} package',
+% \newblock January 2005.
+% \newblock (Available from CTAN in \url{macros/latex/contrib/mftinc})
+%
%
% \end{thebibliography}
%
@@ -313,16 +428,18 @@
%
% \section{The code} \label{sec:mf}
%
-% Most of the code below is an edited version of code used in
-% \verb?nfssfont.tex? for displaying aspects of the set of glyphs in a font.
-%
% \begin{macrocode}
%<*pack>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fonttable}[2009/05/06 v1.4 displays a font]
+\ProvidesPackage{fonttable}[2009/05/14 v1.51 displays a font]
% \end{macrocode}
%
+% \subsection{Table and texts}
+%
+% Most of the code below is an edited version of code used in
+% \texttt{nfssfont.tex} for displaying aspects of the set of glyphs in a font.
+%
% \begin{macro}{\sevenrm}
% A small fixed size roman font.
% \begin{macrocode}
@@ -817,10 +934,15 @@ official r\^ole in fluffy souffl\'es? }
% \end{macro}
%
% \begin{macro}{\germantext}
+% \begin{macro}{\germanparatext}
% Text from the \Lpack{Blindtext} package.
% \changes{v1.1}{2006/10/02}{Added \cs{germantext}}
+% \changes{v1.51}{2009/05/14}{Changed \cs{germantext} to \cs{germanparatext}}
% \begin{macrocode}
-\newcommand*{\germantext}{%
+\providecommand*{\germantext}{%
+ \PackageWarning{fonttable}{\protect\germantext\space is deprecated,
+ \MessageBreak use \protect\germanparatext\space instead}}
+\newcommand*{\germanparatext}{%
Dies hier ist ein Blindtext zum Testen von Textausgaben. Wer
diesen Text liest, ist selbst schuld. Der Text gibt lediglich den
Grauwert der Schrift an. Ist das wirklich so? Ist es
@@ -838,12 +960,20 @@ falsche Anmutung vermitteln.\par}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\latintext}
+% \begin{macro}{\latinparatext}
% The traditional printers' text.
% \changes{v1.1}{2006/10/02}{Added \cs{latintext}}
+% \changes{v1.51}{2009/05/14}{Changed \cs{latintext} to \cs{latinparatext}
+% because of a clash with the babel package}
% \begin{macrocode}
-\newcommand*{\latintext}{%
+\providecommand*{\latintext}{%
+ \PackageWarning{fonttable}{\protect\latintext\space may be overriden by the
+ babel package \MessageBreak use
+ \protect\latinparatext\space instead}}
+\newcommand*{\latinparatext}{%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam
lobortis facilisis sem. Nullam nec mi et neque pharetra
sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper,
@@ -860,6 +990,7 @@ turpis accumsan semper.\par}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\simpletext}
% \begin{macro}{\fulltext}
@@ -926,6 +1057,171 @@ turpis accumsan semper.\par}
% \end{macro}
% \end{macro}
%
+% \subsection{Testing a glyph}
+%
+% This is a reimplementation of Donald Knuth's \texttt{testfont.tex} which
+% is available from CTAN and there is also a commented version in Appendix H
+% of \textit{The METAFONT Book}.
+%
+% \begin{macro}{\fnthours}
+% \begin{macro}{\f@ttwodigits}
+% The time of day on a 24 hour clock.
+% \begin{macrocode}
+%%%%%%%% using \@tempcnta for Knuth's \m and \@tempcntb for his \n
+\newcommand*{\fnthours}{\@tempcntb=\time \divide\@tempcntb 60
+ \@tempcnta=-\@tempcntb \multiply\@tempcnta 60 \advance\@tempcnta \time
+ \f@ttwodigits\@tempcntb:\f@ttwodigits\@tempcnta}
+\newcommand*{\f@ttwodigits}[1]{\ifnum #1<10 0\fi \number#1}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\f@tgettsechars}
+% \begin{macro}{\f@ttchar}
+% \begin{macro}{\f@tschar}
+% \begin{macro}{\f@techar}
+% \cs{f@tgettsechars}\marg{T}\marg{S}\marg{E} gets three characters
+% and \cs{chardef}s \cs{f@ttchar} to \meta{T} (the test character),
+% \cs{f@tschar} to \meta{S} (start character) and \cs{f@techar}
+% to \meta{E} (the end character).
+% \begin{macrocode}
+\newcommand*{\f@tgettsechars}[3]{%
+ \chardef\f@ttchar=#1 \chardef\f@tschar=#2 \chardef\f@techar=#3}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyphmixture}
+% \begin{macro}{\f@tmixpattern}
+% \begin{macro}{\f@tdomix}
+% \cs{glyphmixture}\marg{T}\marg{S}\marg{E} sets a mix of \meta{T} within
+% the glyph range from \meta{S} to \meta{E} according to the pattern
+% \cs{f@tmixpattern}. The work is done by \cs{f@tdomix}.
+% \begin{macrocode}
+\newcommand*{\glyphmixture}[3]{\f@tgettsechars{#1}{#2}{#3}%
+ \f@tdomix\f@tmixpattern}
+\newcommand*{\f@tmixpattern}{\0\1\0\0\1\1\0\0\0\1\1\1\0\1}
+\newcommand*{\f@tdomix}[1]{\par\chardef\0=\f@ttchar \@tempcntb=\f@tschar
+ \loop \chardef\1=\@tempcntb #1\endgraf
+ \ifnum \@tempcntb<\f@techar \advance\@tempcntb \@ne \repeat}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyphalternation}
+% \begin{macro}{\f@taltpattern}
+% These are similar to \cs{glyphmixture} and \cs{f@tmixpattern} except
+% that the glyphs are alternated.
+% \begin{macrocode}
+\newcommand*{\glyphalternation}[3]{\f@tgettsechars{#1}{#2}{#3}%
+ \f@tdomix\f@taltpattern}
+\newcommand*{\f@taltpattern}{\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\f@tdisc}
+% For breaking long lines so that the test character will be at the end
+% of one line and repeated at the start of the next one.
+% \begin{macrocode}
+\newcommand*{\f@tdisc}{\discretionary{\f@ttchar}{\f@ttchar}{\f@ttchar}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\glyphseries}
+% \begin{macro}{\f@tdoseries}
+% \cs{glyphseries}\marg{T}\marg{S}\marg{E} puts the test character \meta{T}
+% between all the others in the range \meta{S} to \meta{E}. The work is
+% done by \cs{f@tdoseries}.
+% \begin{macrocode}
+\newcommand*{\glyphseries}[3]{\f@tgettsechars{#1}{#2}{#3}%
+ \f@tdisc\f@tdoseries\f@tschar\f@techar\par}
+\newcommand*{\f@tdoseries}[2]{\@tempcntb=#1\relax
+ \loop\char\@tempcntb\f@tdisc
+ \ifnum\@tempcntb<#2\advance\@tempcntb \@ne \repeat}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyphalphabet}
+% \begin{macro}{\GLYPHALPHABET}
+% \begin{macro}{\f@tcomplower}
+% \begin{macro}{\f@tcompupper}
+% \cs{glyphalphabet}\marg{T} inserts the test glyph \meta{T} between the lowercase
+% alphabetic characters. Similarly \cs{GLYPHALPHABET}\marg{T} does
+% the same with the uppercase characters. The work is done by, respectively,
+% \cs{f@tcomplower} and \cs{f@tcompupper}.
+% \begin{macrocode}
+\newcommand*{\glyphalphabet}{\f@tcomplower}
+\newcommand*{\GLYPHALPHABET}{\f@tcompupper}
+\newcommand*{\f@tcomplower}[1]{\chardef\f@ttchar=#1
+ \f@tdisc\f@tdoseries{`a}{`z}\f@tdoseries{31}{34}\par}
+\newcommand*{\f@tcompupper}[1]{\chardef\f@ttchar=#1
+ \f@tdisc\f@tdoseries{`A}{`Z}\f@tdoseries{35}{37}\par}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyphlowers}
+% \begin{macro}{\glyphuppers}
+% \begin{macro}{\glyphdigits}
+% \begin{macro}{\f@tclc}
+% \begin{macro}{\f@tcuc}
+% \begin{macro}{\f@tdgs}
+% \begin{macro}{\f@tdocomprehensive}
+% These macros generate an extended mix of characters of a particular kind.
+% The work is done by \cs{f@tdocomprensive} wih \cs{f@tclc}, \cs{f@tcuc}, and
+% \cs{f@tdgs} setting up the glyph sets.
+% \begin{macrocode}
+\newcommand*{\glyphlowers}{\f@tdocomprehensive\f@tclc{`a}{`z}{31}{34}}
+\newcommand*{\glyphuppers}{\f@tdocomprehensive\f@tcuc{`A}{`Z}{35}{37}}
+\newcommand*{\glyphdigits}{\f@tdocomprehensive\f@tdgs{`0}{`4}{`5}{`9}}
+\newcommand*{\f@tdocomprehensive}[5]{\par\chardef\f@ttchar=#2
+ \loop{#1} \ifnum\f@ttchar<#3\@tempcnta=\f@ttchar\advance\@tempcnta \@ne
+ \chardef\f@ttchar=\@tempcnta \repeat
+ \chardef\f@ttchar=#4
+ \loop{#1} \ifnum\f@ttchar<#5\@tempcnta=\f@ttchar\advance\@tempcnta \@ne
+ \chardef\f@ttchar=\@tempcnta \repeat}
+\newcommand*{\f@tclc}{\f@tdisc\f@tdoseries{`a}{`z}\f@tdoseries{31}{34}\par}
+\newcommand*{\f@tcuc}{\f@tdisc\f@tdoseries{`A}{`Z}\f@tdoseries{35}{37}\par}
+\newcommand*{\f@tdgs}{\f@tdisc\f@tdoseries{`0}{`9}\par}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyphpunct}
+% \begin{macro}{\f@tdopunct}
+% \cs{glyphpunct} sets punctuation marks in combination with different
+% sorts of letters. The work is done by \cs{f@tdopunct}.
+% \begin{macrocode}
+\newcommand*{\glyphpunct}{\par\f@tdopunct{min}\f@tdopunct{pig}\f@tdopunct{hid}
+ \f@tdopunct{HIE}\f@tdopunct{TIP}\f@tdopunct{fluff}
+ \$1,234.56 + 7/8 = 9\% @ \#0\par}
+\newcommand*{\f@tdopunct}[1]{#1,\ #1:\ #1;\ `#1'\
+ ?`#1?\ !`#1!\ (#1)\ [#1]\ #1*\ #1.\par}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% The end of the package.
% \begin{macrocode}
%</pack>