summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex')
-rw-r--r--Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex76
1 files changed, 49 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex b/Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex
index 80bac586ad1..91dce06491e 100644
--- a/Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex
+++ b/Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex
@@ -62,7 +62,7 @@
\catcode`\^=7 %
\newlinechar=`\^^J %
\message{^^J}%
- \message{load-unicode-xetex-classes.tex v1.1a (2016-01-06)^^J}%
+ \message{load-unicode-xetex-classes.tex v1.1b (2016-01-08)^^J}%
\message{Reading Unicode east Asian character class data^^J}%
% A string version of |#| will be needed to look for comment lines in the
% source. Once that is done proper parsing can begin.
@@ -91,21 +91,6 @@
\next
}%
\let\repeat\fi
-% For the East Asian width data, save the class of the current token.
- \def\parseunicodedataIII#1..#2..#3\relax#4{%
- \expandafter\def\csname EAW@\number"#1\endcsname{#4}%
- \ifx\relax#2\relax
- \else
- \let\savedbody\body
- \count0="#1 %
- \loop
- \ifnum\count0<"#2 %
- \advance\count0 by 1 %
- \expandafter\def\csname EAW@\number\count0\endcsname{#4}%
- \repeat
- \let\body\savedbody
- \fi
- }%
% A shared routine for reading the data files: only one part of the parser
% has to be altered.
\def\storedpar{\par}%
@@ -126,8 +111,6 @@
\catcode`\#=6 %
\closein0 %
}%
-% Read the east Asian width data: no settings are made at this stage.
- \readandparse{EastAsianWidth}%
% Set up the different line break classes recognised.
\ifdefined\XeTeXcharclassID
\else
@@ -159,8 +142,9 @@
\fi
% Check the line break class and if necessary the east Asian width for the
% current code point. For code points of class |ID| there may be a range to
-% set, and these are always recorded. In other cases check the east Asian width
-% and set the class if appropriate.
+% set, and these are always recorded. In other cases if the code point is
+% one of those we may need to set up then save it for checking against the
+% list of east Asian widths.
\def\ID{ID}%
\def\parseunicodedataIII#1..#2..#3\relax#4{%
\def\temp{#4}%
@@ -171,12 +155,19 @@
\parseunicodedataIV{#1}{#2}%
\fi
\else
- \ifnum 0%
- \if F\csname EAW@\number"#1\endcsname 1\fi
- \if H\csname EAW@\number"#1\endcsname 1\fi
- \if W\csname EAW@\number"#1\endcsname 1\fi
- >0 %
- \global\XeTeXcharclass"#1=\csname XeTeXcharclass#4\endcsname
+ \ifcsname XeTeXcharclass#4\endcsname
+ \ifx\relax#2\relax
+ \expandafter\def\csname LB@\number"#1\endcsname{#4}%
+ \else
+ \let\savedbody\body
+ \count0="#1 %
+ \loop
+ \unless\ifnum\count0>"#2 %
+ \expandafter\def\csname LB@\number\count0 \endcsname{#4}%
+ \advance\count0 by 1 %
+ \repeat
+ \let\body\savedbody
+ \fi
\fi
\fi
}%
@@ -186,11 +177,42 @@
\begingroup
\count0="#1 %
\loop
- \ifnum\count0<"#2 %
+ \unless\ifnum\count0>"#2 %
\global\XeTeXcharclass\count0=\XeTeXcharclassID
\advance\count0 by 1 %
\repeat
\endgroup
}%
\readandparse{LineBreak}%
+% For |EastAsianWidth.txt|, action is only needed if the character has width
+% |F|, |H| or |W|. Once again there may be a range of characters to handle.
+ \def\parseunicodedataIII#1..#2..#3\relax#4{%
+ \ifnum 0%
+ \if F\firsttoken#4\relax 1\fi
+ \if H\firsttoken#4\relax 1\fi
+ \if W\firsttoken#4\relax 1\fi
+ >0 %
+ \ifx\relax#2\relax
+ \parseunicodedataIV{"#1}%
+ \else
+ \begingroup
+ \count0="#1 %
+ \loop
+ \unless\ifnum\count0>"#2 %
+ \parseunicodedataIV{\count0}%
+ \advance\count0 by 1 %
+ \repeat
+ \endgroup
+ \fi
+ \fi
+ }%
+% Only take action if a line breaking class was previously saved: that will
+% map to the correct class number.
+ \def\parseunicodedataIV#1{%
+ \ifcsname LB@\number#1\endcsname
+ \global\XeTeXcharclass#1=
+ \csname XeTeXcharclass\csname LB@\number#1\endcsname\endcsname
+ \fi
+ }%
+ \readandparse{EastAsianWidth}%
\endgroup