%
% myjfonts.sty : Revised pLaTeX 2e Japanese Font Definition
%                  with supporting Morisawa Fonts
%
% $Id: ext-jfonts.sty,v 1.2 1999/02/26 19:44:51 yutaka Exp $
%
% - use JIS metrics and Japanese PostScript fonts from pLaTeX
% - tie \sffamily and \ttfamily with japanese gothic fonts
%
% Install appropriate TFM files and VF files, setup dvips and xdvi
% correctly before using this package.
%
% usage: \usepackage[options]{ext-jfonts}
%   options are:
%          [jis]  use JIS metrics (jis, jisg, *-J)
%          [3fonts,4fonts,5fonts] use extended Postscript Fonts
%
%                \mcfamily           \gtfamily
%            normal     bold     normal     bold
% ------------------------------------------------
%  normal     min       goth      min       goth   (jis, jisg with [jis])
%  3fonts    Ryumin    FutoGo   GothicBBB  FutoGo
%  4,5fonts  Ryumin    FutoMin  GothicBBB  FutoGo
%
% Author: Yutaka Oiwa <oiwa@is.s.u-tokyo.ac.jp>
%
\ProvidesPackage{ext-jfonts}[1999/02/27 Multi-Japanese-Font Package]
\makeatletter
%
\newif\if@jistfm@\@jistfm@false
\newif\if@fivefonts@\@fivefonts@false
\newif\if@threefonts@\@threefonts@false
%
\DeclareOption{jis}{\@jistfm@true}
\DeclareOption{3fonts}{\@threefonts@true\@fivefonts@false}
\DeclareOption{4fonts}{\@threefonts@true\@fivefonts@true}
\DeclareOption{5fonts}{\@threefonts@true\@fivefonts@true}
\ProcessOptions

\if@jistfm@
  \def\@omin@{<-> jis}
  \def\@ogoth@{<-> jisg}
  \def\@min@{<-> Ryumin-Light-J}
  \def\@goth@{<-> GothicBBB-Medium-J}
  \def\@minb@{<-> FutoMinA101-Bold-J}
  \def\@gothb@{<-> FutoGoB101-Bold-J}
\else
  \def\@omin@{<5> <6> <7> <8> <9> <10> sgen*min <-> min10}
  \def\@ogoth@{<5> <6> <7> <8> <9> <10> sgen*goth <-> goth10}
  \def\@min@{<-> Ryumin-Light-H}
  \def\@goth@{<-> GothicBBB-Medium-H}
  \def\@minb@{<-> FutoMinA101-Bold-H}
  \def\@gothb@{<-> FutoGoB101-Bold-H}
\fi
\def\@vomin@{<5> <6> <7> <8> <9> <10> sgen*tmin <-> tmin10}
\def\@vogoth@{<5> <6> <7> <8> <9> <10> sgen*tgoth <-> tgoth10}
\def\@vmin@{<-> Ryumin-Light-V}
\def\@vgoth@{<-> GothicBBB-Medium-V}
\def\@vminb@{<-> FutoMinA101-Bold-V}
\def\@vgothb@{<-> FutoGoB101-Bold-V}

\if@threefonts@
  \if@fivefonts@
    \relax
  \else
    \def\@minb@{<->ssub*gt/bx/n}
    \let\@vminb@=\@minb@
  \fi
\else
  \def\@min\@omin
  \def\@minb@{<->ssub*gt/bx/n}
  \def\@goth@{<->ssub*gt/bx/n}
  \let\@gothb@\@ogoth@
  \def\@vmin\@vomin
  \def\@vminb@{<->ssub*gt/bx/n}
  \def\@vgoth@{<->ssub*gt/bx/n}
  \let\@vgothb@\@vogoth@
\fi

% DIRTY TRICK to unload original fonts
\expandafter\let\csname JY1/mc/m/n/10\endcsname\relax
\expandafter\let\csname JY1/mc/m/n/10.95\endcsname\relax
\expandafter\let\csname JY1/mc/m/n/12\endcsname\relax
\expandafter\let\csname JT1/mc/m/n/10\endcsname\relax
\expandafter\let\csname JT1/mc/m/n/10.95\endcsname\relax
\expandafter\let\csname JT1/mc/m/n/12\endcsname\relax
%
%
% Horizontal Encoding
%
% Mincho Font Family
%
\DeclareKanjiFamily{JY1}{mc}{}
\DeclareFontShape{JY1}{mc}{m}{n}{\@min@}{}
\DeclareFontShape{JY1}{mc}{m}{it}{<->ssub*mc/m/n}{}
\DeclareFontShape{JY1}{mc}{m}{sl}{<->ssub*mc/m/n}{}
\DeclareFontShape{JY1}{mc}{m}{sc}{<->ssub*mc/m/n}{}
\DeclareFontShape{JY1}{mc}{m}{ui}{<->ssub*mc/m/n}{}
\DeclareFontShape{JY1}{mc}{bx}{n}{\@minb@}{}
\DeclareFontShape{JY1}{mc}{bx}{it}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JY1}{mc}{bx}{sl}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JY1}{mc}{bx}{sc}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JY1}{mc}{bx}{ui}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JY1}{mc}{b}{n}{<->ssub*mc/bx/n}{}
%
% Gothic Font Family: Gothic-M added
%
\DeclareKanjiFamily{JY1}{gt}{}
\DeclareFontShape{JY1}{gt}{m}{n}{\@goth@}{}
\DeclareFontShape{JY1}{gt}{m}{it}{<->ssub*gt/m/n}{}
\DeclareFontShape{JY1}{gt}{m}{sl}{<->ssub*gt/m/n}{}
\DeclareFontShape{JY1}{gt}{m}{sc}{<->ssub*gt/m/n}{}
\DeclareFontShape{JY1}{gt}{m}{ui}{<->ssub*gt/m/n}{}
\DeclareFontShape{JY1}{gt}{bx}{n}{\@gothb@}{}
\DeclareFontShape{JY1}{gt}{bx}{it}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JY1}{gt}{bx}{sl}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JY1}{gt}{bx}{sc}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JY1}{gt}{bx}{ui}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JY1}{gt}{b}{n}{<->ssub*gt/bx/n}{}
%
%
%% Vertical Encoding
%
% Mincho Font Family
%
\expandafter\ifx\csname T@JT1\endcsname\relax\endinput\fi
\DeclareKanjiFamily{JT1}{mc}{}
\DeclareFontShape{JT1}{mc}{m}{n}{\@vmin@}{}
\DeclareFontShape{JT1}{mc}{m}{it}{<->ssub*mc/m/n}{}
\DeclareFontShape{JT1}{mc}{m}{sl}{<->ssub*mc/m/n}{}
\DeclareFontShape{JT1}{mc}{m}{sc}{<->ssub*mc/m/n}{}
\DeclareFontShape{JT1}{mc}{m}{ui}{<->ssub*mc/m/n}{}
\DeclareFontShape{JT1}{mc}{bx}{n}{\@vminb@}{}
\DeclareFontShape{JT1}{mc}{bx}{it}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JT1}{mc}{bx}{sl}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JT1}{mc}{bx}{sc}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JT1}{mc}{bx}{ui}{<->ssub*mc/bx/n}{}
\DeclareFontShape{JT1}{mc}{b}{n}{<->ssub*mc/bx/n}{}
%
% Gothic Font Family
%
\DeclareKanjiFamily{JT1}{gt}{}
\DeclareFontShape{JT1}{gt}{m}{n}{\@vgoth@}{}
\DeclareFontShape{JT1}{gt}{m}{it}{<->ssub*gt/m/n}{}
\DeclareFontShape{JT1}{gt}{m}{sl}{<->ssub*gt/m/n}{}
\DeclareFontShape{JT1}{gt}{m}{sc}{<->ssub*gt/m/n}{}
\DeclareFontShape{JT1}{gt}{m}{ui}{<->ssub*gt/m/n}{}
\DeclareFontShape{JT1}{gt}{bx}{n}{\@vgothb@}{}
\DeclareFontShape{JT1}{gt}{bx}{it}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JT1}{gt}{bx}{sl}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JT1}{gt}{bx}{sc}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JT1}{gt}{bx}{ui}{<->ssub*gt/bx/n}{}
\DeclareFontShape{JT1}{gt}{b}{n}{<->ssub*gt/bx/n}{}

\let\romanttfamily\ttfamily
\let\romansffamily\sffamily
\let\romanrmfamily\rmfamily

\if@threefonts@
\let\m@gtfamily\gtfamily
\else
\let\m@gtfamily\mcfamily
\fi

\def\ttfamily{\romanttfamily\m@gtfamily}
\def\sffamily{\romansffamily\m@gtfamily}
\def\rmfamily{\romanrmfamily\mcfamily}

\let\@omin@\relax\let\@ogoth@\relax
\let\@min@\relax\let\@goth@\relax
\let\@minb@\relax\let\@gothb@\relax
\let\@vomin@\relax\let\@vogoth@\relax
\let\@vmin@\relax\let\@vgoth@\relax
\let\@vminb@\relax\let\@vgothb@\relax

\endinput
% end of ext-jfonts.sty
