summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-02-13 23:36:18 +0000
committerKarl Berry <karl@freefriends.org>2011-02-13 23:36:18 +0000
commitc7e46de6460a5f1a70081a27033654c5e0b8ec22 (patch)
tree690026068852ef405790d99ff72504ea15e6f0c5 /Master/texmf-dist/source
parent694f30a239c1e636b21e6ec9f11746c98c8ac3cf (diff)
fonttable (13feb11)
git-svn-id: svn://tug.org/texlive/trunk@21399 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/fonttable/fonttable.dtx106
1 files changed, 73 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/fonttable/fonttable.dtx b/Master/texmf-dist/source/latex/fonttable/fonttable.dtx
index 8c4b6018cde..735668fe291 100644
--- a/Master/texmf-dist/source/latex/fonttable/fonttable.dtx
+++ b/Master/texmf-dist/source/latex/fonttable/fonttable.dtx
@@ -5,6 +5,7 @@
% Author: Peter Wilson (Herries Press)
% Maintainer: Will Robertson (will dot robertson at latex-project dot org)
% Copyright 2005--2009 Peter R. Wilson
+% 2009--2011 Will Robertson
%
% This work may be distributed and/or modified under the
% conditions of the Latex Project Public License, either
@@ -16,6 +17,14 @@
%
% This work consists of the files listed in the README file.
%
+%<pack>\NeedsTeXFormat{LaTeX2e}
+%<pack>\ProvidesPackage{fonttable}
+%<*driver>
+\ProvidesFile{fonttable.dtx}
+%</driver>
+%<*driver|pack>
+ [2011/02/13 v1.6b displays a font]
+%</driver|pack>
%
%<*driver>
\documentclass[twoside]{ltxdoc}
@@ -54,7 +63,7 @@
%
% \fi
%
-% \CheckSum{911}
+% \CheckSum{945}
%
% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
% \DoNotIndex{\@centercr,\@cite}
@@ -107,19 +116,8 @@
% \changes{v1.51}{2009/05/14}{Eliminated a clash with babel package}
% \changes{v1.5b}{2009/09/02}{New maintainer (Will Robertson)}
% \changes{v1.6}{2009/10/15}{New spacing of the decimals from Peter Wilson}
+% \changes{v1.6b}{2011/02/13}{Fix bug with Spanish babel}
%
-% \def\fileversion{v1.0} \def\filedate{2005/11/27}
-% \def\fileversion{v1.0a} \def\filedate{2005/12/06}
-% \def\fileversion{v1.1} \def\filedate{2006/10/02}
-% \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}
-% \def\fileversion{v1.5b} \def\filedate{2009/09/02}
-% \def\fileversion{v1.5c} \def\filedate{2009/09/20}
-% \def\fileversion{v1.5d} \def\filedate{2009/09/22}
-% \def\fileversion{v1.6} \def\filedate{2009/10/15}
% \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
@@ -129,16 +127,15 @@
% \newcommand*{\AD}{\textsc{ad}}
% \newcommand*{\thisfont}{OandS}
%
-% \title{The \Lpack{fonttable} package\thanks{This
-% file has version number \fileversion, last revised
-% \filedate.}}
+% \GetFileInfo{fonttable.dtx}
+% \title{The \Lpack{fonttable} package}
%
% \author{%
% Author: Peter Wilson, Herries Press\\
% Maintainer: Will Robertson\\
% \texttt{will dot robertson at latex-project dot org}%
% }
-% \date{\filedate}
+% \date{\fileversion\qquad \filedate}
% \maketitle
% \begin{abstract}
% The package lets you typeset the characters in a font in tabular and/or
@@ -436,9 +433,6 @@
%
% \begin{macrocode}
%<*pack>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fonttable}[2009/10/15 v1.6 displays a font]
-
% \end{macrocode}
%
% \subsection{Table and texts}
@@ -501,27 +495,73 @@
% The original code for the macro was supplied by Enrico Gregorio.
% \changes{v1.4}{2009/05/06}{Added \cs{xfonttable}}
% \begin{macrocode}
-\newcommand*{\xfonttable}[4]{\bgroup
- \pikfont{#1}{#2}{#3}{#4}%
- \edef\f@tfontname{\fontname\font}\normalfont
- \f@tstartfont
- \ftable
- \egroup}
-
+\newcommand*{\xfonttable}[4]{%
+ \begingroup
+ \pikfont{#1}{#2}{#3}{#4}%
+ \edef\f@tfontname{\fontname\font}%
+% \end{macrocode}
+% New: strip any size information from the fontname (which could be, e.g.,
+% either `\verb*|cmr10|' or `\verb*|cmr10 at 10pt|'.)
+% This wasn't necessary before because we didn't explicitly choose the font
+% size; it was inferred automatically.
+% \begin{macrocode}
+ \edef\@tempa{\string a\string t}%
+ \edef\@tempb{\noexpand\in@{\@tempa}{\f@tfontname}}%
+ \@tempb
+ \ifin@
+ \edef\f@tfontname{\expandafter\f@tstripsize\f@tfontname}%
+ \fi
+% \end{macrocode}
+% End new code, and finish as before:
+% \begin{macrocode}
+ \normalfont
+ \f@tstartfont
+ \ftable
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\f@tstripsize}
+% Needed above.
+% \begin{macrocode}
+\edef\@tempa{%
+ \def\noexpand\f@tstripsize
+ ##1\string a\string t##2\string p\string t{##1}%
+}
+\@tempa
% \end{macrocode}
% \end{macro}
%
+%
% \begin{macro}{\f@tstartfont}
% Sets up for a font table.
% \begin{macrocode}
-\newcommand*{\f@tstartfont}{\font\f@ttestfont=\f@tfontname
+\newcommand*{\f@tstartfont}{%
+% \end{macrocode}
+% New: scale the font by 0.01\% to (attempt to) avoid TeX's font optimisation.
+% This becomes a problem in Spanish babel, say, when \verb|\textfont\fam|
+% changes when \verb|cmr10| has been loaded under a different name, here.
+% (And the \verb|\textfont| can no longer be parsed correctly. See:
+% \url{http://latex-alive.tumblr.com/post/3229118083/texs-font-loading-optimisation}
+% )
+% \begin{macrocode}
+ \@tempdima=\f@size pt
+ \font\f@ttestfont=\f@tfontname\space at 0.9999\@tempdima\relax
+% \end{macrocode}
+% Continue as before:
+% \begin{macrocode}
\f@ttestfont \f@tsetbaselineskip
- \ifdim\fontdimen6\f@ttestfont<10pt \rightskip=0pt plus 20pt
- \else\rightskip=0pt plus 2em \fi
+ \ifdim\fontdimen6\f@ttestfont<10pt\relax
+ \rightskip=0pt plus 20pt\relax
+ \else
+ \rightskip=0pt plus 2em\relax
+ \fi
\spaceskip=\fontdimen2\f@ttestfont % space between words (\raggedright)
- \xspaceskip=\fontdimen2\f@ttestfont \advance\xspaceskip
- by\fontdimen7\f@ttestfont}
-
+ \xspaceskip=\fontdimen2\f@ttestfont
+ \advance\xspaceskip by\fontdimen7\f@ttestfont
+}
% \end{macrocode}
% \end{macro}
%