home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / TEXDISK / TEX1.ZIP / EMTEX / TEXINPUT / FNTBL.TEX < prev    next >
Text File  |  1989-11-06  |  6KB  |  176 lines

  1. %=====fontbl.tex
  2. %
  3. % The essential parts of this macro appeared in {\it TUGboat, Volume 3, No. 1}
  4. %
  5. % in the note: "DISPLAY OF A FONT IN TABLE FORM." by Roger L. Beeman.
  6. % This version was rewritten by Pierre A. MacKay to take advantage of
  7. % the new features of \TeX82.  It is now interactive, and prompts the
  8. % user for a font name.  If the font is a text font, a sample paragraph
  9. % is set, which is justified to three times the lower-case alphabet length
  10. % if that will fit in the overall \hsize.  (If the font is a fixed-width
  11. % font such as "amtt", the sample is set with a ragged right margin.)
  12. % The sample is leaded 20% over the stated point-size, so that a
  13. % 10-point font is set 10 on 12.  The length of both upper and lower
  14. % case alphabets is given, along with the height and depth of the
  15. % lower case alphabet and the height of the upper case alphabet.  These
  16. % last dimensions can be very useful for calculating the size of
  17. % close-fitting boxes and struts.
  18. %
  19. % Non-text fonts are displayed in table form only.
  20. %
  21. % If you have \TeX\ running with "plain.tex" loaded,
  22. % you can start this macro by typing "tex fontbl" and you will be prompted
  23. % for the rest
  24. %
  25. \baselineskip 0pt \lineskip 0pt
  26. \vsize 8.5truein
  27. \let\sl=\tensl
  28. \newcount\bighand\newcount\littlehand
  29. \bighand=\time\divide\bighand by 60
  30. \littlehand=\bighand\multiply\littlehand by -60
  31. \advance\littlehand by\time
  32. \def\makedateline{\line{{\sl \fontname scaled \\magstep\step\hfil
  33.   \the\bighand:\ifnum\littlehand<10{0}\fi
  34.   \the\littlehand\ - \the\month/\the\day/\the\year}}}
  35.  
  36. \output{\shipout\vbox{\hrule width1em\vskip 1ex
  37. \makedateline\vskip1em\box255\vskip1em
  38. \hrule width1em}\global\advance\count0 by 1}
  39.  
  40. \newdimen\maxwide
  41. \dimendef\vu=\maxwide
  42. \setbox 9\hbox{\sl 0}
  43.  
  44. \def\spike{\hbox to 0pt{\vbox to 1\ht9{}}}
  45. \def\cell#1{\hbox to \vu{\hfill\char'#1\hfill}\vrule}
  46. \def\label#1{\vbox to 1\ht8{\vfill
  47.   \hbox to 35pt{\hfill\sl '#10\hskip1em}\vfill}\vrule}
  48.  
  49. \def\seprow{\def\m{\hskip \vu{}\vrule height 2pt}\hbox{\m\m\m\m\m\m\m\m}}
  50. \def\cellrow#1{\setbox 8\vbox{\seprow\hbox{\spike\ignorespaces
  51.            \cell{#10}\cell{#11}\cell{#12}\cell{#13}\ignorespaces
  52.            \cell{#14}\cell{#15}\cell{#16}\cell{#17}\ignorespaces
  53.            \hfill}\seprow\hrule}\hbox{\label{#1}\box8}}
  54.  
  55. \def\lcol#1{\hbox to \vu{\hfill{\sl #1}\hfill}\hskip .4pt}
  56. \def\chw#1{\hbox{\char'#1}}
  57.  
  58. \def\colw#1{\vbox{\chw{#10}
  59.           \chw{#11}
  60.           \chw{#12}
  61.           \chw{#13}
  62.           \chw{#14}
  63.           \chw{#15}
  64.           \chw{#16}
  65.           \chw{#17}}}
  66.  
  67. \def\setw#1{\vbox{\colw{#10}
  68.           \colw{#11}
  69.           \colw{#12}
  70.           \colw{#13}
  71.           \colw{#14}
  72.           \colw{#15}
  73.           \colw{#16}
  74.           \colw{#17}}}
  75. \def\getw{\setbox 0\vbox{\setw0\setw1\hbox to 1\wd9{}
  76.       \hbox to 1em{}}\vu=1.625\wd0}
  77.  
  78. \def\table#1{\font\tablefont=#1 scaled \scale
  79. \tablefont\getw\null\vfil
  80. \hbox to 6in{\hfil\ignorespaces
  81. \vbox{\ifdim\fontdimen2\tablefont>0pt \hbox{\hskip35pt \fontname \hfil} \fi
  82.       \vskip10pt
  83.       \hbox{\hskip35pt\lcol0\lcol1\lcol2\lcol3\lcol4\lcol5\lcol6\lcol7}
  84.       \vskip 4 pt
  85.       \hbox{\hskip35pt\vbox{\hrule width 8\vu}\vbox{\hrule width 3.6pt}}
  86.       \cellrow{00}\cellrow{01}\cellrow{02}\cellrow{03}
  87.       \cellrow{04}\cellrow{05}\cellrow{06}\cellrow{07}
  88.       \cellrow{10}\cellrow{11}\cellrow{12}\cellrow{13}
  89.       \cellrow{14}\cellrow{15}\cellrow{16}\cellrow{17}}\ignorespaces
  90. \hss}}
  91. \def\tblraggedright{\rightskip0pt plus5em}
  92.  
  93. \global\def\test{}
  94. \global\def\fin{END }
  95. \global\def\lcfin{end }
  96. \global\def\halfstep{half }
  97. \def\\{$\backslash$}
  98. \def\doit{
  99. \baselineskip 0pt \lineskip 0pt
  100. \message{Type a valid font name, or type END to quit :}
  101. \read16 to\fontname
  102. \ifx\fontname\lcfin\let\test=\fin\else\global\let\test=\fontname\fi
  103. \ifx \fin\test \relax
  104. \else \message{Scaled to what magstep? (half, or 0..5):}
  105. \read16 to\step
  106. \ifx \halfstep\step \global\def\scale{1095 } \else
  107.   \global\def\scale{\ifcase\step 1000\or
  108.     1200\or 1440\or 1728\or 2074\or 2488\fi\relax}
  109.   \fi
  110. \message{Graphing font \fontname}
  111.        \table{\fontname}
  112. \rightskip 0pt % So that one ragged right font doesn't affect all
  113. %    following fonts
  114. \vskip 1em
  115. \ifdim\fontdimen2\tablefont>0pt
  116.   \setbox8=\hbox{abcdefghijklmnopqrstuvwxyz}
  117.   \setbox7=\hbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
  118.   \global\dimen8=1\wd8\global\dimen7=.5\hsize
  119.   \global\dimen5=1\ht8\global\dimen4=1\dp8\global\dimen3=1\ht7
  120.   \edef\length{\the\dimen8}
  121.   \global\dimen6=\dimen8\global\multiply\dimen6 by 3
  122.   \ifdim\dimen6>\hsize \global\dimen6=\hsize \fi
  123.   \ifdim\fontdimen3\tablefont=0pt \tblraggedright
  124.      \global\advance\dimen6 by -40pt \fi
  125.   \vskip 1em
  126.   \noindent
  127.   \ifdim\dimen8<\dimen6
  128.     \line{\unhbox8\hfil }
  129.     \vskip 1ex \fi
  130.   \centerline{{\rm Alphabet length \length. Quad is \the\fontdimen6\tablefont}}
  131.   \vskip .25em
  132.   \centerline{{\rm Lower case height is \the\dimen5 ; depth is \the\dimen4}}
  133.     \vskip 1em
  134.     \global\dimen8=1\wd7 \edef\length{\the\dimen8}
  135.     \noindent
  136.   \ifdim\dimen8<\dimen6
  137.     \line{\unhbox7 \hfil}
  138.     \vskip 1ex  \fi
  139.     \centerline{{\rm Alphabet length \length ; height \the\dimen3}}
  140.   \vskip 1em \vfil
  141.   \vbox{\hsize \dimen6
  142.   \baselineskip 1.2em
  143.   \parskip .15em
  144.   \lineskip .2em
  145.  
  146. The design of low-resolution typefaces is complicated by the need
  147. to achieve two different and rather incompatible ends.  A font which is
  148. exclusively intended for Office Automation equipment should be designed
  149. to make the very best use of that environment.  Its proportions, balance,
  150. shading and letter-spacing can and indeed must be fitted to exact
  151. pixel-bound\-aries, whe\-ther or not the refinements of anti-aliasing are
  152. used.
  153.  
  154. A low-resolution font which was created primarily as the proof-copy
  155. imitation of an associated high-resolu\-tion font will never be quite
  156. so precisely matched to its environment.  Its contours will necessarily be
  157. determined by exact pixel-boundaries, but often not in the way we might
  158. prefer.  It need not be sloppy, but it can never be so well tuned as
  159. a font of the first variety.  It is a poor Platonic reflection of an
  160. idea that cannot be fully known except in the dazzling light
  161. of high-resolution typesetting.  The vast majority of fonts produced
  162. with METAFONT belong to this second variety.  A low-resolution
  163. METAFONT character should be judged for what it is, and not for what
  164. it has never claimed to be.
  165. }
  166. \fi
  167.  
  168. \vfill\penalty-10000
  169.  
  170. \doit
  171. \fi
  172. }
  173.  
  174. \doit
  175. \bye
  176.