% $Id: xetex.ini 37214 2015-05-05 22:32:02Z karl $
% Public domain.  Originally by Jonathan Kew.

%% Disable the \font\preloaded=... entries from plain.tex
%% as xetex is primarily intended for use with other fonts
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \catcode`\^=7 \catcode`\@=11

\scrollmode

\input unicode-letters.def

\let\s@vef@nt=\font
\let\preloaded=2
\def\font{\futurelet\next\d@ntpreload}
\def\d@ntpreload{\ifx\next\preloaded
   \let\next\sk@pf@nt
   \begingroup \catcode`\%=12 \catcode13=12
 \else
   \let\next\s@vef@nt
 \fi \next}
\lccode1=13
\lowercase{\def\sk@pf@nt\preloaded=#1^^A{\endgroup}}

\input etex.src

% restore the \font command and undefine other stuff
\catcode`\@=11
\let\font=\s@vef@nt
\let\d@ntpreload=\und@fined
\let\sk@pf@nt=\und@fined
\let\s@vef@nt=\und@fined

%
% Allocator for \XeTeXintercharclass values, from Enrico Gregorio 
%
\newcount\xe@alloc@intercharclass % allocates intercharclass
\xe@alloc@intercharclass=\thr@@ % from 4 (1,2 and 3 are used by CJK, AFAIK)
\def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne
 \xe@ch@ck#1#4#2% make sure there's still room
 \allocationnumber#1%
 \global#3#5\allocationnumber
 \wlog{\string#5=\string#2\the\allocationnumber}}
\def\xe@ch@ck#1#2#3{%
 \ifnum#1<#2\else
  \errmessage{No room for a new #3}%
 \fi}
\def\newXeTeXintercharclass{%
 \xe@alloc@\xe@alloc@intercharclass\XeTeXintercharclass\chardef\@cclv} %at most 254

% Primitives in pdftex and luatex, we'll just use macros here.
% Since we are generating a whatsit, not 100% compatible,
% but hopefully close enough.
\def\pdfmapfile#1{\special{pdf:mapfile #1}}
\def\pdfmapline#1{\special{pdf:mapline #1}}

\catcode`\@=12

\XeTeXuseglyphmetrics=1
\XeTeXdashbreakstate=1

\errorstopmode

\dump
\endinput
