\catcode`\{=1 % these three catcode settings
\catcode`\}=2 % are needed prior to the
\catcode`\#=6 % reading of plain.tex

\let\originalfont\font
\def\empty{}

\def\truncopteq#1#2\relax{\if#1=#2\else#1#2\fi}
\def\font#1#2 {% space after #1 (font cs) is not allowed
  \def\fntsvdcs{#1}\edef\fntsvdnm{\truncopteq#2\relax}%
  \ifx\fntsvdnm\empty{}% there was a space after `='
    \expandafter\font\expandafter#1%
  \else \originalfont#1 \csname!\fntsvdnm\endcsname \fi
}

\expandafter\def\csname !cmr10\endcsname{qx-lmr10 }
\expandafter\def\csname !cmr9\endcsname{qx-lmr9 }
\expandafter\def\csname !cmr8\endcsname{qx-lmr8 }
\expandafter\def\csname !cmr7\endcsname{qx-lmr7 }% used twice
\expandafter\def\csname !cmr6\endcsname{qx-lmr6 }
\expandafter\def\csname !cmr5\endcsname{qx-lmr5 }
\expandafter\def\csname !cmmi10\endcsname{lmmi10 }
\expandafter\def\csname !cmmi9\endcsname{lmmi9 }
\expandafter\def\csname !cmmi8\endcsname{lmmi8 }
\expandafter\def\csname !cmmi7\endcsname{lmmi7 }
\expandafter\def\csname !cmmi6\endcsname{lmmi6 }
\expandafter\def\csname !cmmi5\endcsname{lmmi5 }
\expandafter\def\csname !cmsy10\endcsname{lmsy10 }
\expandafter\def\csname !cmsy9\endcsname{lmsy9 }
\expandafter\def\csname !cmsy8\endcsname{lmsy8 }
\expandafter\def\csname !cmsy7\endcsname{lmsy7 }
\expandafter\def\csname !cmsy6\endcsname{lmsy6 }
\expandafter\def\csname !cmsy5\endcsname{lmsy5 }
\expandafter\def\csname !cmex10\endcsname{lmex10 }
\expandafter\def\csname !cmss10\endcsname{qx-lmss10 }
\expandafter\def\csname !cmssq8\endcsname{qx-lmssq8 }
\expandafter\def\csname !cmssi10\endcsname{qx-lmsso10 }
\expandafter\def\csname !cmssqi8\endcsname{qx-lmssqo8 }
\expandafter\def\csname !cmbx10\endcsname{qx-lmbx10 }
\expandafter\def\csname !cmbx9\endcsname{qx-lmbx9 }
\expandafter\def\csname !cmbx8\endcsname{qx-lmbx8 }
\expandafter\def\csname !cmbx7\endcsname{qx-lmbx7 }
\expandafter\def\csname !cmbx6\endcsname{qx-lmbx6 }
\expandafter\def\csname !cmbx5\endcsname{qx-lmbx5 }
\expandafter\def\csname !cmtt10\endcsname{qx-lmtt10 }% used twice
\expandafter\def\csname !cmtt9\endcsname{qx-lmtt9 }
\expandafter\def\csname !cmtt8\endcsname{qx-lmtt8 }
\expandafter\def\csname !cmsltt10\endcsname{qx-lmtto10 }
\expandafter\def\csname !cmsl10\endcsname{qx-lmro10 }
\expandafter\def\csname !cmsl9\endcsname{qx-lmro9 }
\expandafter\def\csname !cmsl8\endcsname{qx-lmro8 }
\expandafter\def\csname !cmti10\endcsname{qx-lmri10 }
\expandafter\def\csname !cmti9\endcsname{qx-lmri9 }
\expandafter\def\csname !cmti8\endcsname{qx-lmri8 }
\expandafter\def\csname !cmti7\endcsname{qx-lmri7 }
\expandafter\def\csname !cmu10\endcsname{qx-lmu10 }
\expandafter\def\csname !cmmib10\endcsname{lmmib10 }
\expandafter\def\csname !cmbsy10\endcsname{lmbsy10 }
\expandafter\def\csname !cmcsc10\endcsname{qx-lmcsc10 }
\expandafter\def\csname !cmssbx10\endcsname{qx-lmssbx10 }%used twice
\expandafter\def\csname !cmdunh10\endcsname{qx-lmdunh10 }
\expandafter\def\csname !manfnt\endcsname{manfnt }

% \let\originalinput\input \def\input#1 {}\originalinput plain.tex % test
\input plain.tex

\let\font\originalfont
\let\originalfont\undefined
\let\truncopteq\undefined
\let\fntsvdcs\undefined
\let\fntsvdnm\undefined

\expandafter\let\csname !cmr10\endcsname\undefined
\expandafter\let\csname !cmr9\endcsname\undefined
\expandafter\let\csname !cmr8\endcsname\undefined
\expandafter\let\csname !cmr7\endcsname\undefined
\expandafter\let\csname !cmr6\endcsname\undefined
\expandafter\let\csname !cmr5\endcsname\undefined
\expandafter\let\csname !cmmi10\endcsname\undefined
\expandafter\let\csname !cmmi9\endcsname\undefined
\expandafter\let\csname !cmmi8\endcsname\undefined
\expandafter\let\csname !cmmi7\endcsname\undefined
\expandafter\let\csname !cmmi6\endcsname\undefined
\expandafter\let\csname !cmmi5\endcsname\undefined
\expandafter\let\csname !cmsy10\endcsname\undefined
\expandafter\let\csname !cmsy9\endcsname\undefined
\expandafter\let\csname !cmsy8\endcsname\undefined
\expandafter\let\csname !cmsy7\endcsname\undefined
\expandafter\let\csname !cmsy6\endcsname\undefined
\expandafter\let\csname !cmsy5\endcsname\undefined
\expandafter\let\csname !cmex10\endcsname\undefined
\expandafter\let\csname !cmss10\endcsname\undefined
\expandafter\let\csname !cmssq8\endcsname\undefined
\expandafter\let\csname !cmssi10\endcsname\undefined
\expandafter\let\csname !cmssqi8\endcsname\undefined
\expandafter\let\csname !cmbx10\endcsname\undefined
\expandafter\let\csname !cmbx9\endcsname\undefined
\expandafter\let\csname !cmbx8\endcsname\undefined
\expandafter\let\csname !cmbx7\endcsname\undefined
\expandafter\let\csname !cmbx6\endcsname\undefined
\expandafter\let\csname !cmbx5\endcsname\undefined
\expandafter\let\csname !cmtt10\endcsname\undefined
\expandafter\let\csname !cmtt9\endcsname\undefined
\expandafter\let\csname !cmtt8\endcsname\undefined
\expandafter\let\csname !cmsltt10\endcsname\undefined
\expandafter\let\csname !cmsl10\endcsname\undefined
\expandafter\let\csname !cmsl9\endcsname\undefined
\expandafter\let\csname !cmsl8\endcsname\undefined
\expandafter\let\csname !cmti10\endcsname\undefined
\expandafter\let\csname !cmti9\endcsname\undefined
\expandafter\let\csname !cmti8\endcsname\undefined
\expandafter\let\csname !cmti7\endcsname\undefined
\expandafter\let\csname !cmu10\endcsname\undefined
\expandafter\let\csname !cmmib10\endcsname\undefined
\expandafter\let\csname !cmbsy10\endcsname\undefined
\expandafter\let\csname !cmcsc10\endcsname\undefined
\expandafter\let\csname !cmssbx10\endcsname\undefined
\expandafter\let\csname !cmdunh10\endcsname\undefined
\expandafter\let\csname !manfnt\endcsname\undefined

\dump

