Debian Codegraph @

texmf-dist/tex/generic/tex-ini-files/xetex.ini

raw
1 % tex-ini-files 2026-03-25: xetex.ini
2
3 % Public domain. Originally by Jonathan Kew.
4
5 %% Disable the \font\preloaded=... entries from plain.tex
6 %% as XeTeX is primarily intended for use with other fonts
7 \catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \catcode`\^=7 \catcode`\@=11
8
9 \scrollmode
10
11 % General Unicode set up
12 \input load-unicode-data.tex %
13
14 % Classes that have always been defined by the XeTeX format
15 \input load-unicode-xetex-classes.tex %
16
17 % Let etex.src handle things if eTeX is not enabled!
18 \ifx\XeTeXinterchartoks\undefined
19 \else
20 % basic line-breaking support for CJK etc; override for more sophisticated spacing,
21 % automatic font changes, etc.
22
23 \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax} % between ideographs
24 \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax} % before/after runs of CJK
25
26 \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace}
27 \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace}
28 \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace}
29
30 \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace}
31 \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace}
32 \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace}
33
34 \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue}
35 \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue}
36 \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue}
37
38 \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue}
39 \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue}
40 \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue}
41
42 \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue}
43 \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue}
44 \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue}
45 \fi
46
47 \let\s@vef@nt=\font
48 \let\preloaded=2
49 \def\font{\futurelet\next\d@ntpreload}
50 \def\d@ntpreload{\ifx\next\preloaded
51 \let\next\sk@pf@nt
52 \begingroup \catcode`\%=12 \catcode13=12
53 \else
54 \let\next\s@vef@nt
55 \fi \next}
56 \begingroup
57 \lccode1=13
58 \lowercase{\endgroup
59 \def\sk@pf@nt\preloaded=#1^^A{\endgroup}}
60
61 \input etex.src
62
63 % Restore the \font command and undefine other stuff
64 \catcode`\@=11
65 \let\font=\s@vef@nt
66 \let\d@ntpreload=\und@fined
67 \let\sk@pf@nt=\und@fined
68 \let\s@vef@nt=\und@fined
69
70 %
71 % Allocator for \XeTeXintercharclass values, from Enrico Gregorio
72 %
73 \newcount\xe@alloc@intercharclass % allocates intercharclass
74 \xe@alloc@intercharclass=\thr@@ % from 4 (1,2 and 3 are used by CJK, AFAIK)
75 \def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne
76 \xe@ch@ck#1#4#2% make sure there's still room
77 \allocationnumber#1%
78 \global#3#5\allocationnumber
79 \wlog{\string#5=\string#2\the\allocationnumber}}
80 \def\xe@ch@ck#1#2#3{%
81 \ifnum#1<#2\else
82 \errmessage{No room for a new #3}%
83 \fi}
84 \def\newXeTeXintercharclass{%
85 \xe@alloc@\xe@alloc@intercharclass\XeTeXcharclass\chardef\xe@charclass@boundary}
86
87 % The limit for character class has been enlarged from 256 to 4096 since XeTeX 0.99994.
88 % So the boundary of character class is changed from 255 to 4095.
89 % Primitive \XeTeXinterwordspaceshaping is introduced by XeTeX 0.99994.
90 % We can use it as a flag.
91 \ifx\XeTeXinterwordspaceshaping\und@fined
92 \chardef\xe@charclass@boundary=\@cclv
93 \else
94 \chardef\xe@charclass@boundary=4095 %
95 \fi
96
97 % Primitives in pdfTeX and LuaTeX, we'll just use macros here.
98 % Since we are generating a whatsit, not 100% compatible,
99 % but hopefully close enough.
100 \protected\def\pdfmapfile#1{\special{pdf:mapfile #1}}
101 \protected\def\pdfmapline#1{\special{pdf:mapline #1}}
102
103 \catcode`\@=12
104
105 \XeTeXuseglyphmetrics=1
106 \XeTeXdashbreakstate=1
107
108 \errorstopmode
109
110 \dump
111 \endinput