| 1 |
% make a (fairly large) font chart |
| 2 |
|
| 3 |
\newlinechar=`@ |
| 4 |
\message{@Name of the font to chart = } |
| 5 |
\read-1 to \fontname |
| 6 |
|
| 7 |
\font\f=\fontname at .75in |
| 8 |
\f |
| 9 |
|
| 10 |
% Here's the best way I know to discover character height and depth |
| 11 |
% when they are possibly negative. |
| 12 |
\fontdimen5\f=-10000pt % a new (rather small) xheight |
| 13 |
\textfont0=\f |
| 14 |
\newdimen\h \newdimen\d % will be set to the character's height, depth |
| 15 |
\def\htdp#1{\setbox0=\hbox{\char#1}\h=-\ht0 |
| 16 |
\setbox0=\hbox{\accent#1\char#1}\advance\h\ht0 \advance\h-10000pt |
| 17 |
\setbox0=\null \wd0=-10000pt % in case the character has a charlist! |
| 18 |
\setbox0=\hbox{$\mathaccent#1{\box0}$}% |
| 19 |
\d=\ht0 \advance\d-10000pt \advance\d-\h} |
| 20 |
|
| 21 |
% (By the way, my previous best was this: |
| 22 |
% \textfont15=\f % use family "F |
| 23 |
% \fontdimen8\tenex=0pt % set defaultrulethickness zero |
| 24 |
% \setbox1=\null \ht1=-10000pt \setbox2=\null \dp3=-10000pt |
| 25 |
% \newdimen\d \newdimen\h \newcount\n |
| 26 |
% \n=#1 \advance\n"F00 |
| 27 |
% \setbox0=\hbox{$\radical\n{\copy1}$} |
| 28 |
% \d=\dp0 \advance\d-5000pt \advance\d\d %\showthe\d |
| 29 |
% \setbox0=\hbox{$\radical\n{\copy2}$} |
| 30 |
% \h=\ht0 \advance\h-5000pt \advance\h-.5\d |
| 31 |
% \ifdim\h>0pt \h=.5\h \fi |
| 32 |
% ....very tricky! But it works only when height+depth is positive.) |
| 33 |
|
| 34 |
\tracinglostchars=0 |
| 35 |
\nopagenumbers |
| 36 |
|
| 37 |
\def\testrow#1#2{\setbox0=\hbox{\penalty1\def\\{\char'#1#2}% |
| 38 |
\\0\\1\\2\\3\\4\\5\\6\\7\global\chardef\p=\lastpenalty}} % p=1 if none there |
| 39 |
|
| 40 |
\raggedbottom |
| 41 |
\baselineskip=1in |
| 42 |
\topskip=.75in |
| 43 |
\newdimen\w \w=.75in |
| 44 |
\headline={\vtop{\hbox{\tt\fontname\unskip, page \folio\hfil} |
| 45 |
\kern-.75in\unitsdigits}\hss} |
| 46 |
\footline={\unitsdigits\hss} |
| 47 |
\def\unitsdigits{\hbox{\kern.3in \tt |
| 48 |
\hbox to\w{\ \ 0\hss}% |
| 49 |
\hbox to\w{\ \ 1\hss}% |
| 50 |
\hbox to\w{\ \ 2\hss}% |
| 51 |
\hbox to\w{\ \ 3\hss}% |
| 52 |
\hbox to\w{\ \ 4\hss}% |
| 53 |
\hbox to\w{\ \ 5\hss}% |
| 54 |
\hbox to\w{\ \ 6\hss}% |
| 55 |
\hbox to\w{\ \ 7\hss}}} |
| 56 |
|
| 57 |
\def\row#1#2{\testrow#1#2% |
| 58 |
\ifnum\p=0\hbox{\hbox to.3in{\tt#1#2\hfil}% |
| 59 |
\mod#1#20\mod#1#21\mod#1#22\mod#1#23\mod#1#24\mod#1#25\mod#1#26\mod#1#27% |
| 60 |
\hbox to.3in{\tt\hfil#1#2}}\fi} |
| 61 |
|
| 62 |
\newdimen\pixel \pixel=.00333333in |
| 63 |
\def\mod#1#2#3{\chardef\c='#1#2#3 \htdp\c |
| 64 |
\setbox0=\hbox{\penalty1\c\global\chardef\p=\lastpenalty}% |
| 65 |
\ifnum\p=1 \hbox to\w{}\else |
| 66 |
\setbox2=\hbox{\c\/}% |
| 67 |
\hbox to\w{\kern-\pixel \vrule width\pixel height\h depth\d |
| 68 |
\copy\leftbox\copy0\copy\rightbox |
| 69 |
\vrule width\pixel height\h depth\d \kern-\pixel \kern-\wd0 |
| 70 |
\raise\h\vbox{\hrule height\pixel width\wd0}\kern-\wd0 |
| 71 |
\lower\d\vbox{\hrule height0pt depth\pixel width\wd0}\kern-\wd0 |
| 72 |
\ifdim\wd2>\wd0 \kern\wd2\raise\h\copy\icbox \fi |
| 73 |
\hss}\fi} |
| 74 |
|
| 75 |
\newbox\leftbox % marking the baseline at the left |
| 76 |
\setbox\leftbox=\hbox{\kern-\pixel\vrule width\pixel height4pt |
| 77 |
\vrule height0pt depth\pixel width4pt \kern-4pt} |
| 78 |
\newbox\rightbox % marking the baseline at the right |
| 79 |
\setbox\rightbox=\hbox{\kern-4pt\vrule height0pt depth\pixel width4pt |
| 80 |
\vrule width\pixel height4pt \kern-\pixel} |
| 81 |
\newbox\icbox % the mark of an italic correction |
| 82 |
\setbox\icbox=\hbox{\kern-4pt\vrule height\pixel width4pt depth0pt |
| 83 |
\vrule width\pixel depth4pt} |
| 84 |
|
| 85 |
\row00 \row01 \row02 \row03 \row04 \row05 \row06 \row07 |
| 86 |
\row10 \row11 \row12 \row13 \row14 \row15 \row16 \row17 |
| 87 |
\row20 \row21 \row22 \row23 \row24 \row25 \row26 \row27 |
| 88 |
\row30 \row31 \row32 \row33 \row34 \row35 \row36 \row37 |
| 89 |
\bye |