% TeX file to display a ``font'' made from imagetofont's -strips option.

% Set up our font.
\message{Fontname? }
\read -1 to \testfontname
\font\testfont = \testfontname\space
\testfont

% \monthname produces the name of the month, abbreviated to three
% letters.  The primitive \month should never be zero.
% 
\def\monthname{%
   \ifcase\month
      \or Jan\or Feb\or Mar\or Apr\or May\or Jun%
      \or Jul\or Aug\or Sep\or Oct\or Nov\or Dec%
   \fi
}%

% \timestring produces the current time, in a format like `1:14 p.m.'.
% 
\def\timestring{\begingroup
   \count0 = \time
   \divide\count0 by 60
   \count2 = \count0   % The hour, from zero to 23.
   %
   \count4 = \time
   \multiply\count0 by 60
   \advance\count4 by -\count0   % The minute, from zero to 59.
   % But we need the minutes with a leading zero, if necessary.
   \ifnum\count4<10
      \toks1 = {0}%
   \else
      \toks1 = {}%
   \fi
   % 
   % Convert the hour into `a.m.' or `p.m.', and make it mod 12.
   \ifnum\count2<12
      \toks0 = {a.m.}%
   \else
      \toks0 = {p.m.}%
      \advance\count2 by -12
   \fi
   %
   % If it's midnight, call it `12', not `0'.
   \ifnum\count2=0
      \count2 = 12
   \fi
   %
   % Produce the output.
   \number\count2:\the\toks1 \number\count4 \thinspace \the\toks0
\endgroup}%
%
%
% \timestamp produces a text string for the whole thing like
% `23 Apr 1964  1:14 p.m.'.
%
\def\timestamp{\number\day\space\monthname\space\number\year\quad\timestring}%

\nopagenumbers
\headline = {\hfil \tt \testfontname \quad \timestamp}

% Use as much of the page as we dare.
\hoffset = -5pc  \hsize = 49pc
\voffset = -5pc  \vsize = 64pc

% Don't worry if there's no good place to break pages.
\vbadness = 10000

% No leading between ``lines''.
\offinterlineskip

% Don't worry if the font doesn't have exactly 256 characters, since
% roundoff error makes this likely.
\tracinglostchars = 0


\count255 = 0
\loop
  %\setbox0 = \hbox{\char\count255}
  \leftline{\char\count255}
  \advance\count255 by 1
  \ifnum\count255<256
\repeat

\end
