%%
%% This is file `microtype-xetex.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% microtype.dtx  (with options: `xe-')
%% 
%% ------------------------------------------------------------------------
%% 
%%                       The `microtype' package
%%         Subliminal refinements towards typographical perfection
%%           Copyright (c) 2004--2026 R Schlicht <w.m.l@gmx.net>
%% 
%% 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:
%% https://www.latex-project.org/lppl.txt, and version 1.3c or later is part
%% of all distributions of LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% This work consists of the files microtype.dtx, microtype-utf.dtx and
%% microtype.ins and the derived files microtype.sty, microtype-pdftex.def,
%% microtype-luatex.def, microtype-xetex.def, microtype.lua, letterspace.sty
%% and microtype-show.sty.
%% 
%% ------------------------------------------------------------------------
%%   This file contains enginge-specific definitions.
%% ------------------------------------------------------------------------ 
%%
\ProvidesFile
  {microtype-xetex.def}
  [2026/02/26 v3.2c
   Definitions specific to
   xetex
   (RS)]
\def\MT@ifint#1{%
  \if!\ifnum9<1#1!\else?\fi
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\def\MT@ifdimen#1{%
  \setbox\z@=\hbox{%
    \MT@count=1#1\relax
    \ifnum\MT@count=\@ne
      \aftergroup\@secondoftwo
    \else
      \aftergroup\@firstoftwo
    \fi
  }%
}
\def\MT@ifstreq#1#2{%
  \ifnum
      \strcmp
      {#1}{#2}=\z@
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\def\MT@if@opentype@font{%
  \ifnum\XeTeXfonttype\font@name=\z@
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi
}
\def\MT@do@font#1{%
  \@tempcnta=\z@
  \MT@loop
    \iffontchar\MT@font\@tempcnta #1\fi
    \advance\@tempcnta\@ne
    \ifnum\@tempcnta < \XeTeXlastfontchar\MT@font \MT@repeat
}
  \def\MT@ledmac@setup{%
    \ifMT@protrusion
      \MT@ifdefined@c@TF\l@dunhbox@line{%
        \MT@info@nl{Patching ((r)e)ledmac to enable character protrusion}%
        \let\MT@led@unhbox@line\l@dunhbox@line
        \renewcommand*{\l@dunhbox@line}[1]{%
          \ifhbox##1%
            \kern\leftmarginkern##1%
            \expandafter\MT@led@unhbox@line\expandafter##1\expandafter
            \kern\rightmarginkern##1%
          \fi
        }%
      }{%
        \MT@warning@nl{%
          Character protrusion in paragraphs with line\MessageBreak
          numbering will only work if you update ledmac,\MessageBreak
          or use one of its successors, eledmac or reledmac}%
      }%
    \fi
  }
  \def\MT@varwidth@setup{%
    \ifMT@protrusion
^^Q      \MT@warning@nl{Cannot patch varwidth without etex extensions}%
^^X      \MT@info@nl{Patching varwidth to enable character protrusion}%
^^X      \newdimen\MT@vwid@leftmargin
^^X      \newdimen\MT@vwid@rightmargin
^^X      \patchcmd\@vwid@sift{\sift@deathcycles\z@}
^^X        {\ifhbox\z@ \MT@vwid@leftmargin\leftmarginkern\z@
^^X         \MT@vwid@rightmargin\rightmarginkern\z@\fi \sift@deathcycles\z@}{}{}%
^^X      \patchcmd\@vwid@resetb{\kern\@vwid@loff \unhbox\z@}
^^X        {\kern\@vwid@loff \ifdim\MT@vwid@leftmargin=\z@\else\kern\MT@vwid@leftmargin\fi
^^X         \unhbox\z@ \ifdim\MT@vwid@rightmargin=\z@\else\kern\MT@vwid@rightmargin\fi}{}{}%
^^X      \patchcmd\@vwid@measure{\kern\@vwid@loff \unhbox\z@}
^^X        {\kern\@vwid@loff \ifdim\MT@vwid@leftmargin=\z@\else\kern\MT@vwid@leftmargin\fi
^^X         \unhbox\z@ \ifdim\MT@vwid@rightmargin=\z@\else\kern\MT@vwid@rightmargin\fi}{}{}%
    \fi
  }
\def\MT@setupfont{%
  \MT@font
  \MT@setupfont@hook}
\g@addto@macro\MT@setupfont{%
  \MT@exp@two@c\MT@split@name\string\MT@font/\@nil
  \MT@exp@one@n\MT@find@file\MT@family
  \ifx\MT@familyalias\@empty \else
    \MT@exp@one@n\MT@find@file\MT@familyalias\fi
}
  \g@addto@macro\MT@setupfont\MT@tracking
\g@addto@macro\MT@setupfont{%
  \MT@check@font
  \ifMT@inlist@
  \else
    \MT@vinfo{Setting up font `\MT@@font'\on@line}%
    \MT@info@notracking
  \MT@protrusion
}
\g@addto@macro\MT@setupfont{%
    \MT@register@font
  \fi
}
\def\MT@fix@fontdimen@six{%
  \ifnum\fontdimen6\MT@font=\z@
    \fontdimen6\MT@font=%
               \MT@size pt%
    \MT@info{Fixing zero \@backslashchar fontdimen 6 for font `\MT@@font'\MessageBreak
             (new value: \the\fontdimen6\MT@font)}%
  \fi
  \edef\MT@dimen@six{\number\fontdimen6\MT@font}%
}
\def\MT@set@pr@codes
  {%
 \MT@nofamilyfalse
  \MT@if@list@exists{%
    \ifMT@nofamily
      \MT@ifdefined@n@TF{\MT@encoding-\MT@family-settings}\relax{%
        \MT@info@nl{Loading generic protrusion settings for font family\MessageBreak
                    `\MT@family' (encoding: \MT@encoding).\MessageBreak
                    For optimal results, create family-specific settings.\MessageBreak
                    See the microtype manual for details}%
        \MT@glet@nc{\MT@encoding-\MT@family-settings}\@empty
      }%
    \fi
    \MT@get@opt
    \MT@reset@pr@codes
    \MT@get@inh@list
    \MT@set@inputenc{c}%
    \MT@load@list\MT@pr@c@name
    \MT@set@listname
    \MT@let@cn\@tempc{MT@pr@c@\MT@pr@c@name}%
    \expandafter\MT@set@codes\@tempc,\relax,%
    \MT@set@pr@prefixheirs
  }%
  \MT@reset@pr@codes
}
\def\MT@set@all@pr#1#2{%
  \let\MT@temp\@empty
  \MT@ifempty{#1}\relax{\g@addto@macro\MT@temp{\lpcode\MT@font\@tempcnta=#1}}%
  \MT@ifempty{#2}\relax{\g@addto@macro\MT@temp{\rpcode\MT@font\@tempcnta=#2}}%
  \MT@do@font\MT@temp
}
\def\MT@reset@pr@codes@{\MT@set@all@pr\z@\z@}
\let\MT@reset@pr@codes\relax
\def\MT@the@pr@code{\@tempcntb}
\def\MT@set@codes#1,{%
  \ifx\relax#1\@empty\else
    \MT@split@codes #1==\relax
    \expandafter\MT@set@codes
  \fi
}
\def\MT@split@codes#1=#2=#3\relax{%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty \else
    \MT@get@slot
    \ifx\MT@char\@empty \else
      \MT@get@char@unit
      \csname MT@\MT@feat @split@val\endcsname#2\relax
    \fi
  \fi
}
\def\MT@pr@split@val#1,#2\relax
  {\def\@tempb{#1}%
  \MT@ifempty\@tempb
    \relax
  {\MT@scale@to@em
    \lpcode\MT@font\MT@char=\MT@the@pr@code
  }%
  \def\@tempb{#2}%
  \MT@ifempty\@tempb
    \relax
  {\MT@scale@to@em
    \rpcode\MT@font\MT@char=\MT@the@pr@code
  }%
  \MT@ifdefined@c@T\MT@pr@inh@name{%
    \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@char @}{%
      \MT@exp@cs\MT@map@tlist@c
        {MT@inh@\MT@pr@inh@name @\MT@char @}%
        \MT@set@pr@heirs
    }%
  }%
}
\def\MT@scale@to@em{%
  \@tempcntb=\MT@count\relax
  \MT@scale\@tempcntb \@tempb \MT@dimen@six
  \ifnum\@tempcntb=\z@ \else
    \MT@scale@factor
  \fi
}
\def\MT@get@charwd{%
  \ifnum\MT@char@<\z@
    \setbox\z@=\hbox{\MT@font \XeTeXglyph-\MT@char@}%
    \MT@count=\wd\z@
  \else
    \MT@count=\fontcharwd\MT@font\MT@char@\relax
  \fi
  \ifnum\MT@count=\z@ \MT@info@missing@char \fi
}
\def\MT@set@pr@prefixes#1{\MT@set@pr@prefixes@#1}
\def\MT@set@pr@prefixes@#1#2#3#4%
  {%
  \edef\@tempa{\expandafter\ifx\@car#1\@nil U\@gobble#1\else\number\XeTeXglyphindex"#1" \fi}%
  \edef\@tempb{\expandafter\ifx\@car#2\@nil U\@gobble#2\else\number\XeTeXglyphindex"#2" \fi}%
  \@tempcnta=\z@
  \ifnum#3>\z@
    \@tempcnta=\numexpr
      (\fontcharwd\MT@font\@tempb-\fontcharwd\MT@font\@tempa)%
      *#3/\MT@dimen@six\relax
  \fi
  \lpcode\MT@font #2=\numexpr\lpcode\MT@font#1+\@tempcnta\relax
  \@tempcnta=\z@
  \ifnum#4>\z@
    \@tempcnta=\numexpr
      (\fontcharwd\MT@font\@tempb-\fontcharwd\MT@font\@tempa)%
      *#4/\MT@dimen@six\relax
  \fi
  \rpcode\MT@font #2=\numexpr\rpcode\MT@font#1+\@tempcnta\relax
}
\def\MT@prot@addtoken@next#1{%
  \MT@toks\expandafter{\the\MT@toks#1}%
  \setbox\MT@tempbox\hbox{%
    \begingroup
    \let\maybe@ic\relax
    \MT@exp@one@n\MT@maybe@textcmd{\the\MT@toks}%
    \relax
    \endgroup
    \ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
      \MT@prot@get@nexttoken
      {\MT@exp@one@n\MT@prot@l{\the\MT@toks}}%
}
\let\MT@tr@font@list\@empty
\def\MT@tracking@{%
  \MT@exp@one@n\MT@in@clist\MT@font\MT@tr@font@list
  \ifMT@inlist@\else
    \MT@maybe@do{tr}%
    \ifMT@do\else
      \xdef\MT@tr@font@list{\MT@tr@font@list\MT@font,}%
    \fi
  \fi
}
\let\MT@tracking
  \MT@tracking@
\def\MT@set@tr@codes{%
  \MT@vinfo{Tracking font `\MT@@font'\on@line}%
  \MT@if@list@exists
    \MT@get@tr@opt
    \relax
  \MT@ifdefined@c@TF\MT@letterspace@\relax{\let\MT@letterspace@\MT@letterspace}%
  \ifnum\MT@letterspace@=\z@
    \MT@set@tr@zero
  \else
    \MT@vinfo{... Tracking by \number\MT@letterspace@}%
    \xdef\MT@lsfont{\csname\expandafter\string\font@name
                           /\number\MT@letterspace@ ls\endcsname}%
    \expandafter\ifx\MT@lsfont\relax
      \MT@get@ls@basefont
      \MT@if@opentype@font{%
        \let\MT@tr@features\@empty
        \MT@ifdefined@c@T\MT@tr@feat\MT@tr@set@features
        \global\expandafter\font\MT@lsfont=\MT@ls@fontspec@font
      }{%
        \MT@warning{\MT@@font\space is a legacy font.\MessageBreak
                    Cannot letterspace it}%
        \MT@glet\MT@lsfont\font@name
      }%
      \MT@ifdefined@c@TF\MT@tr@ispace
        {\let\@tempa\MT@tr@ispace}%
        {\edef\@tempa{\MT@letterspace@*,,}}%
      \MT@ifdefined@c@TF\MT@tr@ospace
        {\edef\@tempa{\@tempa,\MT@tr@ospace}}%
        {\edef\@tempa{\@tempa,,,}}%
      \expandafter\MT@tr@set@space\@tempa,%
      \MT@ifdefined@c@TF\MT@tr@okern{\let\@tempa\MT@tr@okern}{\def\@tempa{*,*}}%
      \expandafter\MT@tr@set@okern\@tempa,%
      \MT@ifdefined@c@T\MT@tr@ligatures\MT@tr@noligatures
    \fi
    \aftergroup\MT@set@lsfont
    \let\MT@font\MT@lsfont
    \MT@if@opentype@font\MT@font\relax
    \xdef\MT@set@curr@ls{\def\noexpand\MT@curr@ls{\MT@letterspace@}}%
    \aftergroup\MT@set@curr@ls
    \MT@outer@space=\csname MT@outer@space\expandafter\string\font@name\endcsname\relax
    \xdef\MT@set@curr@os{\MT@outer@space=\the\MT@outer@space\relax}%
    \MT@tr@outer@l
    \ifx\MT@ls@adjust\@empty
      \MT@outer@kern=-\dimexpr\MT@letterspace@ sp * \fontdimen6\font@name/2000\relax
      \MT@ls@outer@k
    \else
      \MT@outer@kern=\expandafter\expandafter\expandafter\@firstoftwo
                      \csname MT@outer@kern\expandafter\string\font@name\endcsname\relax
      \ifdim\MT@outer@kern=\z@\else \MT@ls@outer@k \fi
      \MT@outer@kern=\expandafter\expandafter\expandafter\@secondoftwo
                      \csname MT@outer@kern\expandafter\string\font@name\endcsname\relax
    \fi
    \xdef\MT@set@curr@ok{\MT@outer@kern=\the\MT@outer@kern\relax}%
    \MT@afteraftergroup{%
      \MT@set@curr@os
      \MT@set@curr@ok
      \noexpand\MT@tr@outer@r
    }%
  \fi
}
\def\MT@afteraftergroup#1{%
  \MT@maybe@gobble@with@tikz{%
    \MT@ifdefined@n@TF{MT@aftergroup@\number\currentgrouplevel}\relax{%
      \MT@exp@cs\xdef{MT@aftergroup@\number\currentgrouplevel}%
        {\MT@exp@cs\MT@glet{MT@aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
      \expandafter\aftergroup\expandafter\aftergroup\MT@exp@cs\aftergroup
        {MT@aftergroup@\number\currentgrouplevel}%
    }%
  }%
}
\def\MT@ls@fontspec@font{\MT@exp@two@c\MT@ls@fontspec@font@\fontname\font@name\MT@nil}
\def\MT@ls@fontspec@font@"#1"#2\MT@nil{\MT@ls@fontspec@font@@#1::\MT@nil#2}
\def\MT@ls@fontspec@font@@#1:#2:#3\MT@nil{%
  "#1:#2letterspace=\strip@pt\dimexpr\MT@letterspace@ pt/10\relax
  ;\MT@tr@features"%
}
\def\MT@get@tr@opt{%
  \MT@set@listname
  \let\MT@tr@factor@\@m
  \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name @unit}{%
    \MT@let@cn\MT@tr@unit@{MT@tr@c@\MT@tr@c@name @unit}%
    \ifdim\MT@tr@unit@=1em
      \let\MT@tr@unit@\@undefined
    \else
      \MT@get@unit\MT@tr@unit@
    \fi
  }%
  \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name}{%
    \MT@let@cn\MT@letterspace{MT@tr@c@\MT@tr@c@name}%
    \MT@ifdefined@c@T\MT@tr@unit@{%
      \let\@tempb\MT@letterspace
      \MT@scale@to@em
      \edef\MT@letterspace{\number\@tempcntb}%
    }%
  }%
  \MT@get@tr@opt@{spacing}     {ispace}%
  \MT@get@tr@opt@{outerspacing}{ospace}%
  \MT@get@tr@opt@{outerkerning}{okern}%
  \MT@get@tr@opt@{noligatures} {ligatures}%
  \MT@get@tr@opt@{features}    {feat}%
}
\def\MT@get@tr@opt@#1#2{%
  \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name @#1}%
    {\MT@let@nn{MT@tr@#2}{MT@tr@c@\MT@tr@c@name @#1}}%
}
\def\MT@tr@set@features{%
  \MT@map@clist@c\MT@tr@feat{%
    \MT@ifempty{##1}\relax{%
      \MT@if@false
      \lowercase{\edef\@tempa{##1}}%
      \MT@map@tlist@n{{{required}     {rlig}}
                      {{common}       {liga}}
                      {{contextual}   {clig}}
                      {{rare}         {dlig}}
                      {{discretionary}{dlig}}
                      {{historic}     {hlig}}
                     }\MT@tr@set@feature@
      \ifMT@if@\else
        \MT@ifstreq{\@tempa}{tex}{%
          \MT@xadd\MT@tr@features{mapping=tex-text;}%
        }{%
          \MT@ifstreq{\@tempa}{texoff}{%
            \MT@xadd\MT@tr@features{mapping=;}%
          }{%
            \MT@ifstreq{\@tempa}{notex}{%
              \MT@xadd\MT@tr@features{mapping=;}%
            }{%
              \MT@ifstreq{\@tempa}{resetall}{%
                \MT@xadd\MT@tr@features{+dlig;-dlig;+rlig;-rlig;+liga;-liga;+clig;-clig;+hlig;-hlig;%
                                        mapping=tex-text;%
                                       }%
              }{%
                \MT@warning@nl{Unknown Ligatures feature `##1' in \MT@curr@list@name.
                               Ignoring it}%
              }%
        }}}%
      \fi
    }%
  }%
}
\def\MT@tr@set@feature@#1{%
  \MT@tr@set@feature@@#1%
}
\def\MT@tr@set@feature@@#1#2{%
  \MT@ifstreq\@tempa{#1}{%
    \MT@tr@set@feature@@@{+#2}%
  }{%
    \MT@ifstreq\@tempa{#1off}{%
      \MT@tr@set@feature@@@{-#2}%
    }{%
      \MT@ifstreq\@tempa{no#1}{%
        \MT@tr@set@feature@@@{-#2}%
      }{%
        \MT@ifstreq\@tempa{#1reset}{%
          \MT@tr@set@feature@@@{+#2;-#2}%
        }\relax
      }%
    }%
  }%
}
\def\MT@tr@set@feature@@@#1{%
  \MT@xadd\MT@tr@features{#1;}%
  \MT@if@true
  \MT@tlist@break
}
\def\MT@set@lsfont{\MT@exp@two@c\let\font@name\MT@lsfont}
\DeclareRobustCommand\lsstyle{%
  \not@math@alphabet\lsstyle\textls
  \let\glb@currsize\@empty
  \MT@maybe@gobble@with@tikz{\aftergroup\glb@settings}%
  \def\MT@feat{tr}%
  \let\MT@tracking\MT@set@tr@codes
  \selectfont
}
\DeclareRobustCommand\lslig[1]{%
  {\MT@ifdefined@c@TF\MT@curr@ls{%
     \escapechar\m@ne
     \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
     \MT@get@ls@basefont
     \MT@outer@kern=\dimexpr\MT@curr@ls sp * \fontdimen6\font@name/2000\relax
     \kern\MT@outer@kern
     \font@name #1%
     \kern\MT@outer@kern
  }{#1}}%
}
\def\MT@get@ls@basefont{%
  \xdef\MT@ls@basefont{\csname\expandafter\string\font@name @base\endcsname}%
  \expandafter\ifx\MT@ls@basefont\relax
    \MT@exp@two@c\MT@glet\MT@ls@basefont\font@name
  \else
    \MT@set@lsbasefont
  \fi
}
\def\MT@set@lsbasefont{\MT@exp@two@c\let\font@name\MT@ls@basefont}
\def\MT@set@tr@zero{%
  \xdef\MT@ls@basefont{\csname\expandafter\string\font@name @base\endcsname}%
  \expandafter\ifx\MT@ls@basefont\relax \else
    \aftergroup\MT@set@lsbasefont
  \fi
}
  \def\MT@tr@noligatures{%
    \MT@ifstreq\MT@tr@ligatures{all}\relax{%
      \MT@warning@nl{%
        Disabling (selected) ligatures is
        not possible with\MessageBreak xetex.
        Ignoring `no ligatures' key in \MT@curr@list@name
      }%
      \MT@glet\MT@tr@noligatures\relax
    }%
  }
\newskip\MT@outer@space
\def\MT@tr@set@space#1,#2,#3,#4,#5,#6,{%
  \let\MT@temp\@empty
  \MT@tr@set@space@{#1}{#4}{2}\@empty
  \MT@tr@set@space@{#2}{#5}{3}\@plus
  \MT@tr@set@space@{#3}{#6}{4}\@minus
  \MT@glet@nc{MT@outer@space\expandafter\string\font@name}\MT@temp
}
\def\MT@tr@set@space@#1#2#3#4{%
  \MT@ifempty{#2}{%
    \MT@ifempty{#1}\relax{%
      \MT@tr@set@space@@{#1}{#3}{1000}%
      \fontdimen#3\MT@lsfont=\@tempdima
    }%
    \edef\MT@temp{\MT@temp#4\the\fontdimen#3\MT@lsfont}%
  }{%
    \MT@tr@set@space@@{#2}{#3}{2000}%
    \edef\MT@temp{\MT@temp#4\the\@tempdima}%
    \MT@ifempty{#1}\relax{%
      \MT@tr@set@space@@{#1}{#3}{1000}%
      \fontdimen#3\MT@lsfont=\@tempdima
    }%
  }%
}
\def\MT@tr@set@space@@#1#2#3{%
  \MT@test@ast#1*\@nil{%
    \MT@ifdefined@c@TF\MT@tr@unit@
      {\edef\@tempb{#1}\MT@scale@to@em}
      {\@tempcntb=#1\relax}%
    \@tempdima=\dimexpr\@tempcntb sp*\MT@dimen@six/1000\relax
  }{%
    \MT@ifempty\@tempa{\let\@tempa\MT@letterspace@}\relax
    \@tempdima=\dimexpr \numexpr1000+\@tempa sp *\fontdimen#2\MT@lsfont/1000\relax
  }%
}
\def\MT@tr@outer@l{%
  \ifhmode
    \ifdim\lastskip>5sp
      \edef\x{\the\lastskip minus 0pt}%
      \setbox\z@\hbox{\MT@outer@space=\x}%
      \ifdim\wd\z@>\z@
        \unskip \hskip\MT@outer@space\relax
        \let\MT@ls@outer@k\relax
      \else
        \ifdim\lastskip=%
            \ifnum\spacefactor<2000
              \spaceskip
            \else
              \ifdim\xspaceskip=\z@
                \dimexpr\spaceskip+\fontdimen7\font@name\relax
              \else
                \xspaceskip
              \fi
            \fi
          \unskip \hskip\MT@outer@space\relax
          \let\MT@ls@outer@k\relax
        \fi
      \fi
    \fi
  \fi
}
\def\MT@tr@outer@r{%
  \futurelet\MT@tr@outer@next\MT@tr@outer@r@
}
\def\MT@if@outer@next#1{%
  \ifx\MT@tr@outer@next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}
\def\MT@tr@outer@r@{%
  \def\MT@temp*{}%
  \ifmmode \else
    \ifnum\currentgrouptype=10 \else
      \def\MT@temp*##1{\ifhmode\hskip\MT@outer@space
        \fi}%
      \expandafter\ifcat\expandafter\noexpand\csname MT@tr@outer@next\endcsname\egroup
        \ifhmode\unkern\fi\egroup
        \MT@set@curr@ok \MT@set@curr@os
        \def\MT@temp*{\afterassignment\MT@tr@outer@r\let\MT@temp=}%
      \else
        \MT@if@outer@next\maybe@ic{%
          \MT@set@curr@ok \MT@set@curr@os
          \def\MT@temp*{\afterassignment\MT@tr@outer@icr\let\MT@temp=}%
        }{%
          \MT@if@outer@next\check@icr{%
            \def\MT@temp*{\aftergroup\MT@tr@outer@r\check@icr\let\MT@temp=}%
          }{%
            \MT@if@outer@next\@sptoken{%
              \def\MT@temp* {\ifhmode\hskip\MT@outer@space
                \fi}%
            }{%
              \MT@if@outer@next~{%
                \def\MT@temp*~{\nobreak\hskip\MT@outer@space
                  }%
              }{%
                \MT@if@outer@next\ \relax{%
                  \MT@if@outer@next\space\relax{%
                    \MT@if@outer@next\@xobeysp\relax{%
                      \MT@if@outer@next\xspace{%
                        \def\MT@temp*\xspace{\MT@xspace}%
                      }{%
                        \def\MT@temp*{\ifdim\MT@outer@kern=\z@\else\MT@ls@outer@k
                          \fi}%
                        \MT@let@nc{MT@tr@outer@next}\relax
      }}}}}}}}\fi
  \fi\fi
  \MT@temp*%
}
\def\MT@tr@outer@icr{\afterassignment\MT@tr@outer@icr@\MT@tr@outer@r}
\def\MT@tr@outer@icr@{%
  \let\@let@token= \MT@tr@outer@next
  \maybe@ic@
}
\def\MT@xspace{\futurelet\@let@token\MT@xspace@}
\def\MT@xspace@{\@xspace@firsttrue\@xspace
  \ifdim\lastskip>5sp
    \unskip \hskip\MT@outer@space
  \else
    \ifdim\MT@outer@kern=\z@\else\MT@ls@outer@k \fi
  \fi
}
\def\MT@tr@set@okern#1,#2,{%
  \let\MT@temp\@empty
  \MT@ifempty{#1}{\MT@tr@set@okern@{*}}{\MT@tr@set@okern@{#1}}%
  \MT@ifempty{#2}{\MT@tr@set@okern@{*}}{\MT@tr@set@okern@{#2}}%
  \MT@glet@nc{MT@outer@kern\expandafter\string\font@name}\MT@temp
}
\def\MT@tr@set@okern@#1{%
  \MT@test@ast#1*\@nil{%
    \MT@ifdefined@c@TF\MT@tr@unit@
      {\edef\@tempb{#1}\MT@scale@to@em}
      {\@tempcntb=#1\relax}%
    \@tempdima=\dimexpr \@tempcntb sp * \MT@dimen@six/1000\relax
  }{%
    \MT@ifempty\@tempa{\let\@tempa\@m}\relax
    \@tempdima=\dimexpr \numexpr\@tempa*\MT@letterspace@/1000\relax sp
                      * \fontdimen6\MT@lsfont/2000\relax
  }%
  \edef\MT@temp{\MT@temp{\the\@tempdima}}%
}
\def\MT@ls@outer@k{%
  \ifhmode
    \ifdim\lastkern=-3sp \unkern
      \ifdim\lastkern=3sp \kern-3sp
        \expandafter\expandafter\expandafter\@gobble
      \else \unkern
        \expandafter\expandafter\expandafter\@firstofone
      \fi
    \else
      \expandafter\@firstofone
    \fi
    {\kern\MT@outer@kern\kern3sp\kern-3sp\relax}%
  \fi
}
\def\MT@get@slot@{%
  \ifnum\XeTeXfonttype\MT@font=\z@
  \ifnum\MT@char > \m@ne
    \ifMT@norest \else
      \MT@warn@rest
      \let\MT@char\@empty
    \fi
  \else
    \MT@warn@unknown
    \let\MT@char\@empty
  \fi
  \else
    \ifnum\MT@char=47\relax
      \ifMT@norest \edef\MT@char{U47}%
      \else
        \@tempcnta=\XeTeXglyphindex"\expandafter\@gobble\@tempa"\relax
        \ifnum\@tempcnta=\z@
          \MT@warn@unknown
          \let\MT@char\@empty
        \else
          \edef\MT@char{\@tempa\space}%
          \edef\MT@char@{-\the\@tempcnta}%
        \fi
      \fi
    \else
      \ifnum\MT@char > \m@ne
        \ifMT@norest
          \@tempcnta=\XeTeXcharglyph\MT@char\relax
          \ifnum\@tempcnta=\z@
            \MT@info@missing@char
            \let\MT@char\@empty
          \else
            \edef\MT@char{U\MT@char}%
          \fi
        \else
          \MT@warn@rest
          \let\MT@char\@empty
        \fi
      \else
        \MT@warn@unknown
        \let\MT@char\@empty
      \fi
    \fi
  \fi
}
\def\MT@max@char
  {1114111 }
\def\MT@max@slot
  {1114111 }
  \def\MT@active@features{,tr}%
\renewcommand*\DisableLigatures[2][]{%
  \MT@error{Disabling ligatures of a font is only possible\MessageBreak
    with pdftex version 1.30 or newer.\MessageBreak
    Ignoring \@backslashchar DisableLigatures}{%
    Use
    pdftex.}%
}
\def\SetTracking{%
  \MT@begin@catcodes
  \MT@SetTracking
}
\newcommand*\MT@SetTracking[3][]{%
  \let\MT@extra@context\@empty
  \MT@set@named@keys{MT@tr@c}{#1}%
  \def\MT@permutelist{tr@c}%
  \setkeys{MT@cfg}{#2}%
  \MT@permute
  \KV@@sp@def\@tempa{#3}%
  \MT@ifempty\@tempa\relax{%
    \MT@ifint\@tempa
      {\MT@xdef@n{MT@tr@c@\MT@tr@c@name}{\@tempa}}%
      {\MT@warning{Value `\@tempa' is not a number in\MessageBreak
                   tracking set `\MT@curr@set@name'}}}%
  \MT@end@catcodes
}
  \define@key{MT@pr@c}{context}[]{%
    \MT@error{Protrusion contexts only work with pdftex
        \MessageBreak or luatex.
        Ignoring `context' key\on@line}%
      {Use pdftex or luatex.}%
  }
\MT@define@opt@key{tr}{spacing}
\MT@define@opt@key{tr}{outerspacing}
\MT@define@opt@key{tr}{outerkerning}
\MT@define@opt@key{tr}{features}
\define@key{MT@tr@c}{noligatures}[]%
  {\MT@xdef@n{MT@tr@c@\MT@curr@set@name @noligatures}{#1}}
\define@key{MT@tr@c}{outer spacing}[]{\setkeys{MT@tr@c}{outerspacing={#1}}}
\define@key{MT@tr@c}{outer kerning}[]{\setkeys{MT@tr@c}{outerkerning={#1}}}
\define@key{MT@tr@c}{no ligatures}[]{\setkeys{MT@tr@c}{noligatures={#1}}}
\def\MT@inh@split#1=#2=#3\relax{%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty \else
    \expandafter\MT@has@inh@prefix\@tempa()\relax\@nil
    \MT@get@slot
    \ifx\MT@char\@empty\else
      \let\MT@val\MT@char
      \MT@map@clist@n{#2}{%
        \def\@tempa{##1}%
        \ifx\@tempa\@empty \else
          \MT@get@slot
          \ifx\MT@char\@empty\else
            \ifx\MT@inh@prefix\@empty
              \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @\MT@val @}{{\MT@char}}%
            \else
              \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @prefixes}%
                  {{{\MT@val}{\MT@char}\MT@inh@prefix@}}%
            \fi
          \fi
        \fi
      }%
    \fi
  \fi
}
\MT@def@bool@opt{DVIoutput}{%
  \csname if\@tempa\endcsname
    \MT@warning@nl{Ignoring `DVIoutput' option}%
  \fi
}
  \MT@def@bool@opt{copyfonts}{%
    \csname if\@tempa\endcsname
      \MT@error
        {The `copyfonts' option does not work with xetex}
        {Use pdftex or luatex instead.}%
    \fi
  }
\def\MT@define@optionX#1#2{%
  \define@key{MTX}{#1}[true]{%
    \edef\@tempb{\csname MT@rbba@#1\endcsname}%
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@ifempty\MT@val\relax{%
        \@tempcnta=\m@ne
        \MT@ifstreq\MT@val{true}{%
          \MT@checksetup{#1}{%
            \@tempcnta=\csname MT@\@tempb @level\endcsname
            \MT@vinfo{Enabling #1
                    (level \number\csname MT@\@tempb @level\endcsname)\on@line}%
          }%
        }{%
          \MT@ifstreq\MT@val{false}{%
            \@tempcnta=\z@
            \MT@vinfo{Disabling #1\on@line}%
          }{%
            \MT@ifstreq\MT@val{compatibility}{%
              \MT@checksetup{#1}{%
                \@tempcnta=\@ne
                \MT@let@nc{MT@\@tempb @level}\@ne
                \MT@vinfo{Setting #1 to level 1\on@line}%
              }%
            }{%
              \MT@ifstreq\MT@val{nocompatibility}{%
                \MT@checksetup{#1}{%
                  \@tempcnta=\tw@
                  \MT@let@nc{MT@\@tempb @level}\tw@
                  \MT@vinfo{Setting #1 to level 2\on@line}%
                }%
              }{\MT@error{Value `\MT@val' for key `#1' not recognised}
                         {Use any of `true', `false', `compatibility' or
                          `nocompatibility'.}%
              }%
            }%
          }%
        }%
        \ifnum\@tempcnta>\m@ne
          #2\@tempcnta\relax
        \fi
      }%
    }%
  }%
}
\def\MT@checksetup#1{%
  \csname ifMT@#1\endcsname
    \expandafter\@firstofone
  \else
    \MT@error{You cannot enable #1 if it was disabled\MessageBreak
              in the package options}{Load microtype with #1 enabled.}%
    \expandafter\@gobble
  \fi
}
\MT@define@optionX{protrusion}\MT@protrudechars
\let\MT@protrudechars\XeTeXprotrudechars
\define@key{MTX}{expansion}[true]{\MT@warning{Ignoring expansion setup}}
  \def\MT@define@optionX@#1#2{%
    \define@key{MTX}{#1}[true]{%
      \MT@map@clist@n{##1}{%
        \KV@@sp@def\MT@val{####1}%
        \MT@ifempty\MT@val\relax{%
          \@tempcnta=\m@ne
          \MT@ifstreq\MT@val{true}{%
            \MT@checksetup{#1}{%
              \@tempcnta=\@ne
              \MT@vinfo{Enabling #1\on@line}%
            }%
          }{%
            \MT@ifstreq\MT@val{false}{%
              \@tempcnta=\z@
              \MT@vinfo{Disabling #1\on@line}%
            }{\MT@error{Value `\MT@val' for key `#1' not recognised}
                       {Use either `true' or `false'}%
            }%
          }%
          \ifnum\@tempcnta>\m@ne
            #2\relax
          \fi
        }%
      }%
    }%
  }
  \MT@define@optionX@{tracking}{\ifnum\@tempcnta=\z@ \let\MT@tracking\MT@set@tr@zero
                                \else \let\MT@tracking\MT@tracking@ \fi}
\define@key{MTX}{kerning}[true]{\MT@warning{Ignoring kerning setup}}
\define@key{MTX}{spacing}[true]{\MT@warning{Ignoring spacing setup}}
\define@key{MTX}{activate}[true]{%
  \setkeys{MTX}{protrusion={#1}}%
}
\let\MT@setup@PDF\relax
\let\MT@setup@copies\relax
\def\MT@setup@protrusion{%
  \ifMT@protrusion
    \edef\MT@active@features{\MT@active@features,pr}%
    \MT@protrudechars\MT@pr@level
    \MT@info@nl{Character protrusion enabled (level \number\MT@pr@level)%
      \ifnum\MT@pr@factor=\MT@factor@default \else,\MessageBreak
        factor: \number\MT@pr@factor\fi
      \ifx\MT@pr@unit\@empty \else,\MessageBreak unit: \MT@pr@unit\fi}%
    \MT@check@active@set{pr}%
  \else
    \let\MT@protrusion\relax
    \MT@info@nl{No character protrusion}%
  \fi
}
\def\MT@setup@expansion{%
  \ifMT@expansion
    \ifMT@opt@expansion
      \MT@error{Font expansion does not work with xetex}
               {Use pdftex or luatex instead.}%
    \fi
  \fi
}
  \def\MT@setup@tracking{%
    \ifMT@tracking
      \MT@info@nl{Tracking enabled}%
      \MT@check@active@set{tr}%
      \ifMT@protrusion\else\MT@protrudechars\@ne\fi
    \else
      \let\MT@tracking\relax
      \MT@info@nl{No adjustment of tracking}%
    \fi
  }
  \def\MT@error@doesnt@work#1{%
    \csname ifMT@#1\endcsname
      \MT@error{The #1 feature only works with pdftex 1.40\MessageBreak
        or newer. Switching it off}
        {Use pdftex instead.}%
      \csname MT@#1false\endcsname
      \MT@let@nc{MT@#1}\relax
    \else
      \MT@info@nl{No adjustment of #1%
      }%
    \fi
  }
  \def\MT@setup@kerning {\MT@error@doesnt@work{kerning}}
  \def\MT@setup@spacing {\MT@error@doesnt@work{spacing}}
\def\MT@setup@warntracking
{%
  \ifnum\MT@letterspace=\m@ne
    \let\MT@letterspace\MT@letterspace@default
  \else
    \MT@ls@too@large\MT@letterspace
  \fi
}
\let\MT@setup@noligatures\relax
\endinput
%%
%% End of file `microtype-xetex.def'.
