\makeatletter
\if@deluxe
\newcommand{\fmdefault}{fma}
\DeclareRobustCommand{\UTF}[1]{\begingroup%
  \edef\reserved@gt{\gtdefault}\edef\reserved@mg{\mgdefault}%
  \edef\reserved@mc{\mcdefault}\edef\reserved@fm{\fmdefault}%
  \edef\reserved@md{\mddefault}%
  \ifx \k@family\reserved@gt   % gtfamily
    \kanjifamily{utfjg}%
  \else                         % ~gtfamily
    \ifx \k@family\reserved@mg  % mg
      \kanjifamily{utfjmg}%
      \else                     % ~mg
        \ifx \k@family\reserved@mc % mc
          \ifx \k@series\reserved@md % md_s
            \ifx \reserved@mc\reserved@fm % \renewcommand{\mcdefault}{fma}
              \kanjifamily{utfj}\kanjiseries{bx}%
            \else                               % \mcdefault=rml
              \kanjifamily{utfj}% 
            \fi
          \else                 % mc & ~md_s
            \kanjifamily{utfjg}\kanjiseries{m}%
          \fi                 % md_s end
        \else                 % ~mc
          \ifx \k@family\reserved@fm % fm
            \ifx \k@series\reserved@md % fm & md_s
              \kanjifamily{utfj}\kanjiseries{bx}%
            \else               % fm & ~md_s
              \kanjifamily{utfjg}\kanjiseries{m}%
            \fi                 % fm & md_s end
          \else                 % ~fm
            \kanjifamily{utfj}%
          \fi                   % fm end
        \fi                     % mc end
      \fi                       % mg end
    \fi                         % gt end
  \uppercase{\set@character="#1}%
  \endgroup%
}
\DeclareRobustCommand{\CID}[1]{\begingroup%
  \edef\reserved@gt{\gtdefault}\edef\reserved@mg{\mgdefault}%
  \edef\reserved@mc{\mcdefault}\edef\reserved@md{\mddefault}%
  \edef\reserved@fm{\fmdefault}%
  \ifx \k@family\reserved@gt   % gtfamily
    \kanjifamily{cidjg}%
  \else                         % ~gtfamily
    \ifx \k@family\reserved@mg  % mg
      \kanjifamily{cidjmg}%
      \else                     % ~mg
        \ifx \k@family\reserved@mc % mc
          \ifx \k@series\reserved@md % md_s
            \ifx \reserved@mc\reserved@fm % \renewcommand{\mcdefault}{fma}
              \kanjifamily{cidj}\kanjiseries{bx}%
            \else                               % \mcdefault=rml
              \kanjifamily{cidj}% 
            \fi
          \else                 % mc & ~md_s
            \kanjifamily{cidjg}\kanjiseries{m}%
          \fi                 % md_s end
        \else                 % ~mc
          \ifx \k@family\reserved@fm % fm
            \ifx \k@series\reserved@md % fm & md_s
              \kanjifamily{cidj}\kanjiseries{bx}%
            \else               % fm & ~md_s
              \kanjifamily{cidjg}\kanjiseries{m}%
            \fi                 % fm & md_s end
          \else                 % ~fm
            \kanjifamily{cidj}%
          \fi                   % fm end
        \fi                     % mc end
      \fi                       % mg end
    \fi                         % gt end
  \set@character=#1%
  \endgroup%
}
\fi
\makeatother
