%% file `memucs-gremph.sty`
%% part of memhangul
\ProvidesPackage{memucs-gremph}

\RequirePackage{xkeyval}

\newif\if@bfemph\@bfemphfalse
%\DeclareOption{bfemph}{\@bfemphtrue}
%\ProcessOptions
\DeclareOptionX{bfemph}[]{\@bfemphtrue}
%\newif\if@gremph\@gremphtrue

\newif\if@vargremphhangulfont\@vargremphhangulfontfalse
\newif\if@vargremphhanjafont\@vargremphhanjafontfalse
\DeclareOptionX{gremphhangul}[utgr]{\@vargremphhangulfonttrue\def\GrEmphFont{#1}}
\DeclareOptionX{gremphhanja}[utgt]{\@vargremphhanjafonttrue\def\GrEmphHanjaFont{#1}}
%\define@key{dhucs-gremph.sty}{gremphhangulfont}[utgr]{\@vargremphhangulfonttrue\def\GremphFont{#1}}
%\define@key{dhucs-gremph.sty}{gremphhanjafont}[utgt]{\@vargremphhanjafonttrue\def\GrEmphHanjaFont{#1}}

\ProcessOptionsX

%\if@bfemph
%	\def\GrEmphFont{utbt}
%	\def\GrEmphHanjaFont{utbt}
%\else
  \if@vargremphhangulfont\else
	\def\GrEmphFont{utgr}\fi
	\if@vargremphhanjafont\else
	\def\GrEmphHanjaFont{utgt}\fi
%\fi
%\def\SetGremphFonts#1#2{%
%	\def\GrEmphFont{#1}%
%	\def\GrEmphHanjaFont{#2}%
%}

\if@bfem
\DeclareFontFamily{LUC}{grem}{\hyphenchar \font\m@ne}
\DeclareFontShape{LUC}{grem}{m}{n}{<-> LUC * o\GrEmphFont b}{}
\DeclareFontShape{LUC}{grem}{m}{it}{<-> LUC * o\GrEmphFont b}{}
\DeclareFontShape{LUC}{grem}{m}{sl}{<-> LUC * o\GrEmphFont b}{}
\DeclareFontFamily{LUC}{gremhj}{\hyphenchar \font\m@ne}
\DeclareFontShape{LUC}{gremhj}{m}{n}{<-> LUC * o\GrEmphHanjaFont b}{}
\DeclareFontShape{LUC}{gremhj}{m}{it}{<-> LUC * o\GrEmphHanjaFont b}{}
\DeclareFontShape{LUC}{gremhj}{m}{sl}{<-> LUC * o\GrEmphHanjaFont b}{}
\else
\DeclareFontFamily{LUC}{grem}{\hyphenchar \font\m@ne}
\DeclareFontShape{LUC}{grem}{m}{n}{<-> LUC * o\GrEmphFont m}{}
\DeclareFontShape{LUC}{grem}{m}{it}{<-> LUC * o\GrEmphFont m}{}
\DeclareFontShape{LUC}{grem}{m}{sl}{<-> LUC * o\GrEmphFont m}{}
\DeclareFontFamily{LUC}{gremhj}{\hyphenchar \font\m@ne}
\DeclareFontShape{LUC}{gremhj}{m}{n}{<-> LUC * o\GrEmphHanjaFont m}{}
\DeclareFontShape{LUC}{gremhj}{m}{it}{<-> LUC * o\GrEmphHanjaFont m}{}
\DeclareFontShape{LUC}{gremhj}{m}{sl}{<-> LUC * o\GrEmphHanjaFont m}{}
\fi 

\if@gremph
\DeclareRobustCommand\itshape
        {\not@math@alphabet\itshape\mathit
         \fontshape\itdefault\selectfont\SetAdhocFonts{grem}{gremhj}}
%\DeclareRobustCommand\slshape\itshape
\DeclareRobustCommand\slshape
        {\not@math@alphabet\slshape\relax
         \fontshape\sldefault\selectfont\SetAdhocFonts{grem}{gremhj}}
\else\fi
\def\regremph{%
	\@gremphtrue
	\DeclareRobustCommand*{\itshape}%
        {\not@math@alphabet\itshape\mathit
         \fontshape\itdefault\selectfont\SetAdhocFonts{grem}{gremhj}}%
%	\DeclareRobustCommand\slshape\itshape
    \DeclareRobustCommand\slshape
        {\not@math@alphabet\slshape\relax
         \fontshape\sldefault\selectfont\SetAdhocFonts{grem}{gremhj}}%
}
\def\ungremph{%
	\@gremphfalse
	\DeclareRobustCommand*{\itshape}%
        {\not@math@alphabet\itshape\mathit
         \fontshape\itdefault\selectfont}%
    \DeclareRobustCommand\slshape
        {\not@math@alphabet\slshape\relax
         \fontshape\sldefault\selectfont}%
}
% \slhangul
\def\slhangul#1{%
    \bgroup
    \fontshape{sl}\selectfont #1\egroup
}

\endinput

% end of style.
%
% CHANGE LOG.
% * 2007/08/02. redundant space bug fix
% * 2007/06/08. \slshape independent from \itshape
% * 2005/08/17. \slhangul added.
