\def\fileversion{version 1.0}
\def\filedate{2000/12/05}
\def\docdate{05 Dec 00}
\def\filename{chfont}
%\CheckSum{64}
%\changes{ver.1.0}{05 Dec 00}{First release}
%
%\title{chfont package\thanks{File version \fileversion~last revised \filedate}}
%\author{Tomoaki Honda (plain corporation)}
%\date{\docdate}
%\maketitle
%
%\section{How to use}
%For example, if you write 
%|\usepackage[rm=cmr,sf=phv,tt=cmtt]{chfont}|
%in preamble of your document, it change nothing.
%Ordinaly Computer Modern Fonts is used to typeset your document.
%But |\usepackage[rm=ptm,sf=phv,tt=pcr]{chfont}| 
%is equivalent to times package in PSNFSS.
%You can use the family names of NFSS2 or PSNFSS 
%as the optional "keyval-like" arguments of |\usepackage|.
%The keys of the keyval-like argument of this package is
%"rm" (Roman), "sf" (SanSerif) "tt" (TypewriterText).
%If you use other argument, the keyval package error will occured. 
%
%
%\StopEventually{}
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\usepackage[rm=cmr,sf=phv,tt=pcr]{chfont}
\begin{document}\DocInput{chfont.dtx}\end{document}
%</driver>
%    \end{macrocode}
%
%\section{Macro codes}
%Preamble of this Package.
%    \begin{macrocode}
%<*chfont>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{chfont}[2000/12/05 ver.1.0 honda@plain.co.jp]
%</chfont>
%    \end{macrocode}
%
%We call keyval package and define keys.
%    \begin{macrocode}
%<*chfont>
\RequirePackage{keyval}
\define@key{\@currname}{rm}{\edef\ch@rm{#1}}
\define@key{\@currname}{sf}{\edef\ch@sf{#1}}
\define@key{\@currname}{tt}{\edef\ch@tt{#1}}
%</chfont>
%    \end{macrocode}
%
%We set the default values of keys. The default values change
%no fonts. 
%    \begin{macrocode}
%<*chfont>
\edef\ch@rm{cmr}\edef\ch@sf{cmss}\edef\ch@tt{cmtt}
%</chfont>
%    \end{macrocode}
%\begin{macro}{\@setkeys}
%The macro |\@setkeys| bringa the optional arguments of |\usepackage|
%to keyval package.  
%    \begin{macrocode}
%<*chfont>
\def\@setkeys{%
\expandafter\toks@\expandafter{\@ptionlist{\@currname.\@currext}}%
\edef\reserved@a{\the\toks@}%
\edef\set@key{\noexpand\setkeys\noexpand\@currname{\reserved@a}}%
\set@key%
}%
\@setkeys%
%</chfont>
%    \end{macrocode}
%\end{macro}
%
%Here we reset the list of the optional argument of |\usepackage|.
%    \begin{macrocode}
%<*chfont>
\expandafter\let\csname opt@\@currname.\@currext\endcsname\realx
%</chfont>
%    \end{macrocode}
%
%Here we change the default fonts.
%    \begin{macrocode}
%<*chfont>
\renewcommand{\rmdefault}{\ch@rm}
\renewcommand{\sfdefault}{\ch@sf}
\renewcommand{\ttdefault}{\ch@tt}
%</chfont>
%    \end{macrocode}
%    \begin{macrocode}
\endinput
%    \end{macrocode}
%\Finale