%% xob-dotemph.sty
%%
%% Copyright (c) 2007-2014 Kangsoo Kim <karnes at ktug org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%  http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2006/05/20 or later.
%%
%% xob-dotemph
%%  2014-06-15, \useremph redefined
%%  2014-04-29
%%  2010-03-18
%%  오전 9:01 2008-10-22
%% xetexko-dotemph의 확장
%%  dhucs/hangul compatible (\dotemph, \circemph, \useremph)
%% ----------
%% \useremph is different from kotex-utf's \useremph ***
%%
%% Updated for xetexko v2.1
%% Kihwang Lee <leekh at ktug.org>
%% 2013.08.26
%%
%%
\protected\def\circemph#1{%
	\begingroup
	\def\dotemphchar{^^^^02da}\dotemph{#1}%
	\endgroup
}

\def\xob@useremph#1{\begingroup
    \let\dotemphchar\useremphchar
    \let\dotemphraise\useremphraisedim
    \dotemph{#1}\endgroup} 

%%%%% 2014/06/15
%%%%% \useremph[dim][char]{letter}
%%%%%
\RequirePackage{xparse}

\ExplSyntaxOn

\dim_new:N \useremphraisedim \dim_set:Nn \useremphraisedim { 1ex }
\tl_set:Nn \useremphchar { ^^^^02da }

\DeclareDocumentCommand \useremph { o o m }
{
	\IfValueT { #1 }
	{
		\tl_if_empty:nF { #1 }
		{
			\settoheight \useremphraisedim { #3 }
			\dim_add:Nn \useremphraisedim { #1 }
		}
	}
	
	\IfValueT { #2 }
	{
		\tl_if_empty:nF { #2 }
		{
			\tl_set:Nn \useremphchar { #2 }
		}
	}
	\xob@useremph { #3 }
}

\ExplSyntaxOff

\def\useremphstarblack{\tiny★}
\def\useremphstarwhite{\tiny☆}

\endinput
