diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/base/nfssfont.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/nfssfont.dtx | 123 |
1 files changed, 89 insertions, 34 deletions
diff --git a/Master/texmf-dist/source/latex/base/nfssfont.dtx b/Master/texmf-dist/source/latex/base/nfssfont.dtx index 02da5a8db9d..85cf29fca2d 100644 --- a/Master/texmf-dist/source/latex/base/nfssfont.dtx +++ b/Master/texmf-dist/source/latex/base/nfssfont.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 +% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % @@ -8,12 +8,12 @@ % ------------------------------------------- % % It may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2003/12/01 or later. +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. % % This file has the LPPL maintenance status "maintained". % @@ -26,10 +26,10 @@ % extension .ins) which are part of the distribution. % % \fi -\def\nfssfontfileversion{v2.1a} -\def\nfssfontfiledate{2003/01/12} +\def\nfssfontfileversion{v2.2b} +\def\nfssfontfiledate{2006/01/08} -% \CheckSum{1182} +% \CheckSum{1226} %% \CharacterTable %% {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 %% 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 @@ -48,7 +48,7 @@ % % \iffalse % Copyright (C) 1994 Donald E. Knuth -% Copyright (C) 1994-94,2003 Frank Mittelbach, +% Copyright (C) 1994-94, 2003, 2006 Frank Mittelbach, % all rights reserved. % \fi % @@ -124,12 +124,14 @@ % code documentation. Any volunteers? % \begin{macrocode} %<*code> -\documentclass{article} %FMi -\nofiles %FMi -\textwidth=470pt %FMi -\oddsidemargin=0pt %FMi -\textheight=1000pt %FMi -\def\sevenrm{\fontsize{7}{9pt}\rmfamily} %FMi +\documentclass{article} +\nofiles +\setlength\textwidth{470pt} +\setlength\oddsidemargin{0pt} +\addtolength\textheight{7\baselineskip} +\addtolength\topmargin{-3\baselineskip} + +\def\sevenrm{\fontencoding{OT1}\fontsize{7}{9pt}\rmfamily} \typeout{**********************************************} \typeout{* NFSS font test program version <\nfssfontfileversion>} @@ -168,23 +170,65 @@ {Input external font name, e.g., cmr10^^J% (or <enter> for NFSS classification of font):}% % \end{macrocode} +% If the answer is a real font name (like ``cmr10'') then we have no idea +% what the encoding of this font is, so in this case we record the word +% ``unknown'' and internally assume |T1| encoding. Commands other than +% |\table| are then most likely going to fail, unless that assumption was +% correct. +% \begin{macrocode} + \def\encoding{unkown}% + \fontencoding{T1}\selectfont +% \end{macrocode} % If the user answers with ``return'' we ask for the \NFSS{} % classification of the font in form of encoding, family, series, % shape, and size offering a default each time. % \begin{macrocode} \ifx\currfontname\empty - \begingroup \typein[\encoding]{^^J^^J*** NFSS classification ***^^J^^JFont encoding [T1]:}% \ifx\encoding\empty \fontencoding{T1}% + \def\encoding{T1}% \else % \end{macrocode} -% The requested encoding might not be loaded, so we pretend that it -% was loaded here to avoid an error, after all we only need it to -% find out the external font name. +% Depending on the chosen encoding we have the problem, that the encoding +% support information may not be available (only for |T1| and |OT1| this is +% preloaded in the kernel, all other encodings normally need a declaration in +% the preamble). So here we attempt to load this support file even though +% it is actually already too late for this. +% \begin{macrocode} + \edef\next{% + \lowercase{\def\noexpand\next{\encoding enc.def}}}% + \next + \makeatletter + \InputIfFileExists\next + {}% +% \end{macrocode} +% If the encoding support file is not found this may indicate an error, eg +% something misspelled. However, it may equally mean that we dealing +% with a math font encoding for which no encoding support is +% available. +% \begin{macrocode} + {\PackageWarningNoLine{nfssfont}% + {Encoding file `\next' not found.% + \MessageBreak + You might have misspelt the name of the encoding + \MessageBreak + or perhaps this encoding is not a text encoding, + \MessageBreak + in which case you will probably only be able to + \MessageBreak + run the \noexpand\table command successfully}% +% \end{macrocode} +% But actually the situation is even worse, as some math +% encodings do have such support files. So for them we need to make the encoding +% known to NFSS in some other way, otherwise we could not even find the +% external font name, let alone typesetting a |\table|. % \begin{macrocode} - \expandafter\let\csname T@\encoding\endcsname\empty + \expandafter\let\csname T@\encoding\endcsname\empty + }% + \makeatother + \let\next\relax \fontencoding\encoding \fi \typein[\family]{Font family [cmr]:}% @@ -213,10 +257,9 @@ \fontsize\size\size \fi % \end{macrocode} -% Finally select the font and globally assign it to |\currfontname|. +% Finally select the font and assign it to |\currfontname|. % \begin{macrocode} - \selectfont\xdef\currfontname{\fontname\font}% - \endgroup + \selectfont\edef\currfontname{\fontname\font}% \fi \startfont \message{Now type a test command (\string\help\space for help):}} @@ -224,7 +267,8 @@ % % \begin{macrocode} \def\startfont{\font\testfont=\currfontname - \leftline{\sevenrm Test of \currfontname\unskip\ on \today\ at \hours} + \leftline{\sevenrm Test of font \currfontname\unskip\ (encoding + \encoding\unskip) on \today\ at \hours} \medskip \testfont \setbaselineskip \ifdim\fontdimen6\testfont<10pt \rightskip=0pt plus 20pt @@ -344,11 +388,14 @@ and you can use ordinary TeX commands (e.g., to \input a file).}}} \\M \\N \\O \\P \\Q \\R \\S \\T \\U \\V \\W \\X \\Y \\Z$\par} \math\endgroup} % \end{macrocode} -% +% Here we have to ensure that we use a suitable encoding otherwise our +% octal and hexadecimal constants will appear in whatever encoding the +% current font is. % \begin{macrocode} -\def\oct#1{\hbox{\rmfamily\'{}\kern-.2em\itshape - #1\/\kern.05em}} % octal constant -\def\hex#1{\hbox{\rmfamily\H{}\ttfamily#1}} % hexadecimal constant +\def\oct#1{\hbox{\fontencoding{OT1}\rmfamily\'{}\kern-.2em\itshape + #1\/\kern.05em}}% octal constant +\def\hex#1{\hbox{\fontencoding{OT1}\rmfamily + \H{}\ttfamily#1}}% hexadecimal constant \def\setdigs#1"#2{\gdef\h{#2}% \h=hex prefix; \0\1=corresponding octal \m=\n \divide\m by 64 \xdef\0{\the\m}% \multiply\m by-64 \advance\m by\n \divide\m by 8 \xdef\1{\the\m}} @@ -413,8 +460,8 @@ inculcating love and reverence for the great principles of government as derived from the inalienable rights of man to life, liberty, and the pursuit of happiness.'' \moretext (!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)\par}} -\def\moretext{?`But aren't Kafka's Schlo{\ss} and {\AE}sop's -{\OE}uvres often na{\"\i}ve vis-\`a-vis the d{\ae}monic ph{\oe}nix's +\def\moretext{?`But aren't Kafka's Schlo\ss{} and \AE sop's +\OE uvres often na\"\i ve vis-\`a-vis the d\ae monic ph\oe nix's official r\^ole in fluffy souffl\'es? } \def\omitaccents{\let\moretext=\relax} @@ -422,17 +469,25 @@ official r\^ole in fluffy souffl\'es? } % \end{macrocode} % % \begin{macrocode} -\def\bye{\end{document}} %FMi +\def\bye{\end{document}} % \end{macrocode} % % The redefinition of |\typeout| around the |\begin{document}| % prevents \LaTeX{} from reporting that there is no |.aux| file. % This is a bad hack, I agree :-) % \begin{macrocode} -\let\oldtypeout\typeout %FMi -\def\typeout#1{} %FMi -\begin{document} %FMi -\let\typeout\oldtypeout %FMi +\let\oldtypeout\typeout +\def\typeout#1{} +% \end{macrocode} +% And another bad hack: to be able to load an encoding definition file +% after |\begin{document}| I disable the preamble only setting. +% \begin{macrocode} +\makeatletter +\let\@preamblecmds\@empty +\makeatother + +\begin{document} +\let\typeout\oldtypeout \ifx\noinit!\else\init\fi %</code> |