home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / useful / dist / text / tex / pastex / macros / latex / nfss2 / nfssfont.dtx (.txt) < prev    next >
LaTeX Document  |  1993-08-05  |  15KB  |  347 lines

  1. % \iffalse meta-comment
  2. % Copyright (C) 1989--1993 by Frank Mittelbach, Rainer Schoepf.
  3. % All rights reserved.
  4. % This file is part of the NFSS2 (New Font Selection Scheme) package.
  5. %  This package is distributed in the hope that it will be useful,
  6. %  but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. % IMPORTANT NOTICE:
  9. % For error reports in case of UNCHANGED versions see readme files.
  10. % Please do not request updates from us directly.  Distribution is
  11. % done through Mail-Servers and TeX organizations.
  12. % You are not allowed to change this file.  You may however copy
  13. % this file to a file with a different name and then change the copy
  14. % if you obey the restrictions on file changes described in
  15. % readme.mz.
  16. % You are allowed to distribute this file under the condition that
  17. % it is distributed together with all files mentioned in readme.mz8.
  18. % If you receive only some of these files from someone, complain!
  19. % You are NOT ALLOWED to distribute this file alone.  You are NOT
  20. % ALLOWED to take money for the distribution or use of either this
  21. % file or a changed version, except for a nominal charge for copying
  22. % etc.
  23. % \fi
  24. \def\fileversion{v2.0b}
  25. \def\filedate{93/04/14}
  26. \def\docdate {93/02/28}
  27. % \CheckSum{1136}
  28. %% \CharacterTable
  29. %%  {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
  30. %%   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
  31. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  32. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  33. %%   Dollar        \$     Percent       \%     Ampersand     \&
  34. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  35. %%   Asterisk      \*     Plus          \+     Comma         \,
  36. %%   Minus         \-     Point         \.     Solidus       \/
  37. %%   Colon         \:     Semicolon     \;     Less than     \<
  38. %%   Equals        \=     Greater than  \>     Question mark \?
  39. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  40. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  41. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  42. %%   Right brace   \}     Tilde         \~}
  43. % \iffalse
  44. % Copyright (C) 1993 Frank Mittelbach,
  45. % all rights reserved.
  46. % \fi
  47. % \title{The program {\tt nfssfont}}
  48. % \author{Frank Mittelbach}
  49. % \date{\filedate}
  50. % \MakeShortVerb\|
  51. % \def\dst{{\csname mediumseries\endcsname\sc docstrip}}
  52. % \def\NFSS{{\sf NFSS}}
  53. % \setcounter{StandardModuleDepth}{1}
  54. % \maketitle
  55. % \section{Introduction}
  56. % Within the \NFSS{} distribution there is a \LaTeX{} file
  57. % \texttt{nfssfont.tex} which can be used to test new fonts, produce
  58. % font tables showing all characters, etc. This is an addaption of a
  59. % program originally written by Don Knuth. When you run this file
  60. % through \LaTeX{} you will be asked to enter the name of the font to
  61. % test. Your answer should be the external font name without any
  62. % extension, e.g.\ \texttt{cmr10} (Computer Modern Roman 10pt) or
  63. % \texttt{yinit} (Yannis Haralambous' Initial font). You are then
  64. % requested to enter a command. Probably the most important one is
  65. % |\table|, which will produce a font chart.  To switch to a new test
  66. % font, type |\init|; to finish the test, type |\bye|; and to learn
  67. % about all the other possible tests type |\help|.
  68. % Interfaces and code will probably change  in the future. This is at
  69. % the moment only a crude addaption of the test program for the
  70. % Computer Modern fonts.
  71. % \StopEventually{}
  72. % \section{The code}
  73. % A testbed for font evaluation (see The METAFONTbook, Appendix H)
  74. % changed for \LaTeX{} with \NFSS.
  75. % This program should get a complete rewrite some day. Any volunteer?
  76. %    \begin{macrocode}
  77. %<*code>
  78. \documentstyle{article}               %FMi
  79. \nofiles                              %FMi
  80. \textwidth=470pt                      %FMi
  81. \oddsidemargin=0pt                    %FMi
  82. \textheight=1000pt                    %FMi
  83. \def\sevenrm{\fontsize{7}{9pt}\rm}    %FMi
  84. \typeout{**********************************************}
  85. \typeout{* NFSS font test program version <\fileversion>}
  86. \typeout{*}
  87. \typeout{* Follow the instructions}
  88. \typeout{**********************************************}
  89. \typeout{}
  90. \tracinglostchars=0
  91. \tolerance=1000
  92. \raggedbottom
  93. \parindent=0pt
  94. %\newlinechar=`@               %FMi
  95. \hyphenpenalty=200
  96. \doublehyphendemerits=30000
  97. %    \end{macrocode}
  98. %    
  99. %    \begin{macrocode}
  100. \newcount\m \newcount\n \newcount\p \newdimen\dim
  101. \chardef\other=12
  102. \def\today{\ifcase\month\or
  103.   January\or February\or March\or April\or May\or June\or
  104.   July\or August\or September\or October\or November\or December\fi
  105.   \space\number\day, \number\year}
  106. \def\hours{\n=\time \divide\n 60
  107.   \m=-\n \multiply\m 60 \advance\m \time
  108.   \twodigits\n\twodigits\m}
  109. \def\twodigits#1{\ifnum #1<10 0\fi \number#1}
  110. \def\init{\message{^^JName of the font to test = }
  111.   \read-1 to\fontname \startfont
  112.   \message{Now type a test command (\string\help\space for help):}}
  113. \def\startfont{\font\testfont=\fontname
  114.   \leftline{\sevenrm Test of \fontname\unskip\ on \today\ at \hours}
  115.   \medskip
  116.   \testfont \setbaselineskip
  117.   \ifdim\fontdimen6\testfont<10pt \rightskip=0pt plus 20pt
  118.   \else\rightskip=0pt plus 2em \fi
  119.   \spaceskip=\fontdimen2\testfont % space between words (\raggedright)
  120.   \xspaceskip=\fontdimen2\testfont \advance\xspaceskip 
  121.   by\fontdimen7\testfont}
  122. %    \end{macrocode}
  123. %    
  124. %    \begin{macrocode}
  125. {\catcode`\|=0 \catcode`\\=\other
  126. |gdef|help{|message{%
  127. \init switches to another font;^^J%
  128. \end or \bye finishes the run;^^J%
  129. \table prints the font layout in tabular format;^^J%
  130. \text prints a sample text, assuming TeX text font conventions;^^J%
  131. \sample combines \table and \text;^^J%
  132. \mixture mixes a background character with a series of others;^^J%
  133. \alternation interleaves a background character with a series;^^J%
  134. \alphabet prints all lowercase letters within a given background;^^J%
  135. \ALPHABET prints all uppercase letters within a given background;^^J%
  136. \series prints a series of letters within a given background;^^J%
  137. \lowers prints a comprehensive test of lowercase;^^J%
  138. \uppers prints a comprehensive test of uppercase;^^J%
  139. \digits prints a comprehensive test of numerals;^^J%
  140. \math prints a comprehensive test of TeX math italic;^^J%
  141. \names prints a text that mixes upper and lower case;^^J%
  142. \punct prints a punctuation test;^^J%
  143. \bigtest combines many of the above routines;^^J%
  144. \help repeats this message;^^J%
  145. and you can use ordinary TeX commands (e.g., to \input a file).}}}
  146. \def\setbaselineskip{\setbox0=\hbox{\n=0
  147. \loop\char\n \ifnum \n<255 \advance\n 1 \repeat}
  148. \baselineskip=6pt \advance\baselineskip\ht0 \advance\baselineskip\dp0 }
  149. %    \end{macrocode}
  150. %    
  151. %    \begin{macrocode}
  152. \def\setchar#1{{\escapechar-1\message{\string#1 character = }%
  153.   \def\do##1{\catcode`##1=\other}\dospecials
  154.   \read-1 to\next
  155.   \expandafter\finsetchar\next\next#1}}
  156. \def\finsetchar#1#2\next#3{\global\chardef#3=`#1
  157.   \ifnum #3=`\# \global\chardef#3=#2 \fi}
  158. \def\promptthree{\setchar\background
  159.   \setchar\starting \setchar\ending}
  160. \def\mixture{\promptthree \domix\mixpattern}
  161. \def\alternation{\promptthree \domix\altpattern}
  162. \def\mixpattern{\0\1\0\0\1\1\0\0\0\1\1\1\0\1}
  163. \def\altpattern{\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0}
  164. \def\domix#1{\par\chardef\0=\background \n=\starting
  165.   \loop \chardef\1=\n #1\endgraf
  166.   \ifnum \n<\ending \advance\n 1 \repeat}
  167. \def\!{\discretionary{\background}{\background}{\background}}
  168. \def\series{\promptthree \!\doseries\starting\ending\par}
  169. \def\doseries#1#2{\n=#1\loop\char\n\!\ifnum\n<#2\advance\n 1 \repeat}
  170. \def\complower{\!\doseries{`a}{`z}\doseries{'31}{'34}\par}
  171. \def\compupper{\!\doseries{`A}{`Z}\doseries{'35}{'37}\par}
  172. \def\compdigs{\!\doseries{`0}{`9}\par}
  173. \def\alphabet{\setchar\background\complower}
  174. \def\ALPHABET{\setchar\background\compupper}
  175. \def\lowers{\docomprehensive\complower{`a}{`z}{'31}{'34}}
  176. \def\uppers{\docomprehensive\compupper{`A}{`Z}{'35}{'37}}
  177. \def\digits{\docomprehensive\compdigs{`0}{`4}{`5}{`9}}
  178. \def\docomprehensive#1#2#3#4#5{\par\chardef\background=#2
  179.   \loop{#1} \ifnum\background<#3\m=\background\advance\m 1
  180.   \chardef\background=\m \repeat \chardef\background=#4
  181.   \loop{#1} \ifnum\background<#5\m=\background\advance\m 1
  182.