% -*- coding: utf-8 -*-
\newif\ifuptexmode\uptexmodefalse
\ifnum\jis"2121="3000 \uptexmodetrue\fi

\makeatletter

\def\@opt@{multi}
\def\@default{default}
\def\@jarticle{jarticle}
\def\@tarticle{tarticle}
\def\@ujarticle{ujarticle}
\def\@noreplace{noreplace}

\ifx\option\@undefined
 \def\option{default}
\fi
\ifx\option\@noreplace
 \ifuptexmode
  \ifx\class\@ujarticle
   \def\@enc@{JY2}\def\@dir@{h}
  \else
   \def\@enc@{JT2}\def\@dir@{v}
  \fi
  \DeclareFontFamily{\@enc@}{mcw}{}
  \DeclareFontFamily{\@enc@}{gtw}{}
  \DeclareFontShape{\@enc@}{mcw}{m}{n}{<->s*[0.962216]upjpnrm-\@dir@}{}
  \DeclareFontShape{\@enc@}{gtw}{m}{n}{<->s*[0.962216]upjpngt-\@dir@}{}
  \DeclareFontShape{\@enc@}{gt}{m}{n}{<->s*[0.962216]upjpngt-\@dir@}{}
  \DeclareFontShape{\@enc@}{mcw}{bx}{n}{<->ssub*gt/m/n}{}
  \DeclareFontShape{\@enc@}{gtw}{bx}{n}{<->ssub*gt/m/n}{}
  \DeclareFontShape{\@enc@}{gt}{bx}{n}{<->ssub*gt/m/n}{}
  \DeclareRobustCommand\mcw{\kanjifamily{mcw}\selectfont}
  \DeclareRobustCommand\gtw{\kanjifamily{gtw}\selectfont}
  \renewcommand\mcdefault{mcw}
  \renewcommand\gtdefault{gtw}
 \fi
\fi
\ifx\option\@default
\else
 \edef\@opt@{\option,\@opt@}
\fi

\ifx\class\@undefined
 \ifuptexmode
  \def\class{ujarticle}
 \else
  \def\class{jarticle}
 \fi
\fi
\ifuptexmode
 \edef\@opt@{uplatex,\@opt@}
\fi
\ifx\class\@jarticle
  \documentclass[a4paper,titlepage,draft]{\class}
\else
 \ifx\class\@ujarticle
  \documentclass[a4paper,titlepage,draft]{\class}
 \else
  \documentclass[a4paper,titlepage,draft,landscape]{\class}
 \fi
\fi

\usepackage[\@opt@]{otf}

\makeatother

\usepackage{redeffont}

\ajUTFVarDef{叱}{20B9F}
\ajUTFVarDef{亭}{20158}
\ajUTFVarDef{吉}{20bb7}
\ajUTFVarDef{座}{2B776}

\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}
\pagestyle{empty}
\makeatletter
\ifx\rubyfamily\@undefined\let\rubyfamily=\relax\fi
\ifx\mgfamily\@undefined\let\mgfamily=\relax\fi
\makeatother

\edef\bs{$\backslash$\kern0em}
\setlength\parindent{0em}

\begin{document}
\section{見出し}

コンパイラー：\ifuptexmode upLaTeX\else pLaTeX\fi\\
クラス：\texttt{\class}\\
オプション：\texttt{\option}

\vspace{\baselineskip}
\ifuptexmode
\begin{tabular}{l||ccccccc}
フォント & 仮名 & 漢字 & UTF-8 & \bs kchar & \bs UTF & \bs CID\\
\hline
mc/m & ひらかな & 漢字 & 𠮟𠅘 & \kchar"20B9F\kchar"20158 & \UTF{20B9F}\UTF{20158} & \CID{13803}\CID{20075} \\
mc/bx & {\bfseries ひらかな} & {\bfseries 漢字} & {\bfseries 𠮟𠅘} & {\bfseries\kchar"20B9F\kchar"20158} & {\bfseries\UTF{20B9F}\UTF{20158}} & {\bfseries\CID{13803}\CID{20075}} \\
gt/m & {\gtfamily ひらかな} & {\gtfamily 漢字} & {\gtfamily 𠮟𠅘} & {\gtfamily\kchar"20B9F\kchar"20158} & {\gtfamily\UTF{20B9F}\UTF{20158}} & {\gtfamily\CID{13803}\CID{20075}} \\
gt/bx & {\gtfamily\bfseries ひらかな} & {\gtfamily\bfseries 漢字} & {\gtfamily\bfseries 𠮟𠅘} & {\gtfamily\bfseries\kchar"20B9F\kchar"20158} & {\gtfamily\bfseries\UTF{20B9F}\UTF{20158}} & {\gtfamily\bfseries\CID{13803}\CID{20075}} \\
mg/m & {\mgfamily ひらかな} & {\mgfamily 漢字} & {\mgfamily 𠮟𠅘} & {\mgfamily\kchar"20B9F\kchar"20158} & {\mgfamily\UTF{20B9F}\UTF{20158}} & {\mgfamily\CID{13803}\CID{20075}} \\
\end{tabular}
\else
\begin{tabular}{l||ccccc}
フォント & 仮名 & 漢字 & \bs UTF & \bs CID\\
\hline
mc/m & ひらかな & 漢字 & \UTF{20B9F}\UTF{20158} & \CID{13803}\CID{20075} \\
mc/bx & {\bfseries ひらかな} & {\bfseries 漢字} & {\bfseries\UTF{20B9F}\UTF{20158}} & {\bfseries\CID{13803}\CID{20075}} \\
gt/m & {\gtfamily ひらかな} & {\gtfamily 漢字} & {\gtfamily\UTF{20B9F}\UTF{20158}} & {\gtfamily\CID{13803}\CID{20075}} \\
gt/bx & {\gtfamily\bfseries ひらかな} & {\gtfamily\bfseries 漢字} & {\gtfamily\bfseries\UTF{20B9F}\UTF{20158}} & {\gtfamily\bfseries\CID{13803}\CID{20075}} \\
mg/m & {\mgfamily ひらかな} & {\mgfamily 漢字} & {\mgfamily\UTF{20B9F}\UTF{20158}} & {\mgfamily\CID{13803}\CID{20075}} \\
\end{tabular}
\fi
\vspace{\baselineskip}

日本：\UTF{20509}\UTF{241FE}　簡体字：\UTFC{20509}\UTFC{241FE}  多言語：\UTFM{20509}\UTFM{241FE}

日本：\UTF{20b9f}\UTF{26402}　繁體字：\UTFT{20b9f}\UTFT{26402}  多言語：\UTFM{20b9f}\UTFM{26402}

簡体字：\UTFC{20087}\UTFC{200cc}　繁體字：\UTFT{20087}\UTFT{200cc}  多言語：\UTFM{20087}\UTFM{200cc}

\vspace{\baselineskip}

\ifuptexmode
 \kchar"20B9Fる。
 𠮟る。
\fi
\ajVar{叱}る。
叱る。

\ifuptexmode
 らいおん\kchar"20158。
 らいおん𠅘。
\fi
らいおん\ajVar{亭}。
らいおん亭。

\ifuptexmode
 \kchar"20BB7野家。
 𠮷野家。
\fi
\ajVar{吉}野家。
吉野家。

\ifuptexmode
 銀\kchar"2B776アスター。
 銀𫝶アスター。
\fi
銀\ajVar{座}アスター。
銀座アスター。


\clearpage
[mc/m]

\ifuptexmode
 \input{sp_jp_text}
\fi
\input{sp_jp_utf}

{\bfseries%
[mc/bx]

\ifuptexmode
 \input{sp_jp_text}
\fi
\input{sp_jp_utf}

}

{\gtfamily
[gt/m]

\ifuptexmode
 \input{sp_jp_text}
\fi
\input{sp_jp_utf}

{\bfseries%
[gt/bx]

\ifuptexmode
 \input{sp_jp_text}
\fi
\input{sp_jp_utf}

}}

{\mgfamily
[mg/m]

\ifuptexmode
 \input{sp_jp_text}
\fi
\input{sp_jp_utf}

}

\clearpage
[mc/m]

\input{sp_cns_utf}

\input{sp_gb_utf}

%\end{document}

{\bfseries%
[mc/bx]

\input{sp_cns_utf}

\input{sp_gb_utf}

}

\end{document}


{\gtfamily
[gt/m]

\input{sp_cns_utf}

\input{sp_gb_utf}

{\bfseries%
[gt/bx]

\input{sp_cns_utf}

\input{sp_gb_utf}

}}

\end{document}
