summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/tex-ini-files/xetex.ini
blob: 717589b469355a301c90cd911da47d2e1f58d463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
% tex-ini-files 2016-04-15: xetex.ini

% 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

% General Unicode set up
\input load-unicode-data.tex %

% Classes that have always been defined by the XeTeX format
\input load-unicode-xetex-classes.tex %

% Let etex.src handle things if eTeX is not enabled!
\ifx\XeTeXinterchartoks\undefined
\else
  % basic line-breaking support for CJK etc; override for more sophisticated spacing,
  % automatic font changes, etc.

  \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax} % between ideographs
  \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax} % before/after runs of CJK

  \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace}
  \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace}
  \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace}

  \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace}
  \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace}
  \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace}

  \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue}
  \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue}
  \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue}

  \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue}
  \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue}
  \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue}

  \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue}
  \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue}
  \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue}
\fi

\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\XeTeXcharclass\chardef\xe@charclass@boundary}

% The limit for character class has been enlarged from 256 to 4096 since XeTeX 0.99994.
% So the boundary of character class is changed from 255 to 4095.
% Primitive \XeTeXinterwordspaceshaping is introduced by XeTeX 0.99994.
% We can use it as a flag.
\ifx\XeTeXinterwordspaceshaping\und@fined
  \chardef\xe@charclass@boundary=\@cclv
\else
  \chardef\xe@charclass@boundary=4095 %
\fi

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

\catcode`\@=12

\XeTeXuseglyphmetrics=1
\XeTeXdashbreakstate=1

\errorstopmode

\dump
\endinput