
\newcount \iterator
\tracinglostchars = 2
\def\wterm{\immediate\write16}
\hfuzz = \maxdimen

\def\showtagcodes#1{%
	\iterator = 0
	\loop \ifnum \iterator < 256
      \wlog{ code \the\iterator = \the\tagcode#1\iterator }%
	  \ifnum \the\tagcode#1\iterator>-1
		 \the\iterator{#1 \char \the\iterator}%
	  \fi
	  \advance \iterator 1
	\repeat
}

\def\clearcharcodes#1#2{
	\iterator = 0
	\loop \ifnum \iterator < 256
      \tagcode#1\iterator = #2
	  \advance \iterator 1
	\repeat
}

\def\clearextcodes#1{\clearcharcodes{#1}{-4}}
\def\clearlistcodes#1{\clearcharcodes{#1}{-2}}
\def\clearligcodes#1{\clearcharcodes{#1}{-1}}
\def\clearallcodes#1{\clearcharcodes{#1}{-200}}

\wterm{}
\wterm{Starting tests}
\wterm{	(see the transcript for more information).}

\font\myfont = cmr10
\wterm{cmr10}
\showtagcodes\myfont

\clearligcodes\myfont
\wterm{cmr10 minus ligkerns}
\showtagcodes\myfont

\font\myfont = cmsy10
\wterm{cmsy10}
\showtagcodes\myfont

\clearligcodes\myfont
\wterm{cmsy10 minus ligkerns}
\showtagcodes\myfont

\clearlistcodes\myfont
\wterm{cmsy10 minus ligkerns minus charlist}
\showtagcodes\myfont

\clearextcodes\myfont
\wterm{cmsy10 minus ligkerns minus charlist minus extens}
\showtagcodes\myfont

\font\myfont = cmex10
\wterm{cmex10}
\showtagcodes\myfont

\clearallcodes\myfont
\wterm{cmex10 minus all chartags}
\showtagcodes\myfont

\wterm{nullfont}
\showtagcodes\nullfont

\wterm{not a font (expect an error)}
\chardef\notafont=212
{\nonstopmode	\wlog{ code 0 = \the\tagcode\notafont0 }}
\wterm{Done.}
\bye
