summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/unicode-data
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-11 00:11:27 +0000
committerKarl Berry <karl@freefriends.org>2016-01-11 00:11:27 +0000
commit4e7b7077dfa766b3d271745fa23492a9a10fc5df (patch)
tree9ffe6491a180260e8b0a10c242e6037c71d9801d /Master/texmf-dist/tex/generic/unicode-data
parentb58c2422fdc381e8a6656819c1619ab8b543839d (diff)
unicode-data
git-svn-id: svn://tug.org/texlive/trunk@39342 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/unicode-data')
-rw-r--r--Master/texmf-dist/tex/generic/unicode-data/load-unicode-data.tex39
-rw-r--r--Master/texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex76
2 files changed, 70 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/generic/unicode-data/load-unicode-data.tex b/Master/texmf-dist/tex/generic/unicode-data/load-unicode-data.tex
index 6651255d1d7..77a8f5f1963 100644
--- a/Master/texmf-dist/tex/generic/unicode-data/load-unicode-data.tex
+++ b/Master/texmf-dist/tex/generic/unicode-data/load-unicode-data.tex
@@ -71,7 +71,7 @@
\catcode`\^=7 %
\newlinechar=`\^^J %
\message{^^J}%
- \message{load-unicode-data.tex v1.1a (2016-01-06)^^J}%
+ \message{load-unicode-data.tex v1.1b (2016-01-08)^^J}%
\message{Reading Unicode data^^J}%
% The first stage of parsing is dealing with the fact that there are lots of
% data items separated by |;|. Of those, only a few are needed so they are
@@ -126,6 +126,7 @@
\global\sfcode"#1=999 %
\fi
\else
+ \def\temp{#2}%
\ifnum 0\ifx\temp\Pe 1\fi\ifx\temp\Pf 1\fi>0 %
\global\sfcode"#1=0 %
\fi
@@ -164,12 +165,14 @@
}%
\def\parseunicodedataXII#1;#2\relax#3;#4\relax{%
\if L\firsttoken#4?\relax
- \count0="#3 %
- \loop
- \unless\ifnum\count0>"#1 %
- \parseunicodedataV{\count0}%
- \advance\count0 by 1 %
- \repeat
+ \begingroup
+ \count0="#3 %
+ \loop
+ \unless\ifnum\count0>"#1 %
+ \parseunicodedataV{\count0}%
+ \advance\count0 by 1 %
+ \repeat
+ \endgroup
\fi
}%
% From plain: may not be defined (yet).
@@ -246,21 +249,21 @@
}%
% |MathClass.txt|: this just needs one token of the 'rest' of the line.
% Examine the Unicode class and if known set up the math code appropriately.
- \chardef\L=1 %
- \chardef\B=2 %
- \chardef\V=2 %
- \chardef\R=3 %
- \chardef\O=4 %
- \chardef\C=5 %
- \chardef\P=6 %
- \chardef\A=7 %
+ \chardef\mathclassL=1 %
+ \chardef\mathclassB=2 %
+ \chardef\mathclassV=2 %
+ \chardef\mathclassR=3 %
+ \chardef\mathclassO=4 %
+ \chardef\mathclassC=5 %
+ \chardef\mathclassP=6 %
+ \chardef\mathclassA=7 %
\def\parseunicodedataIV#1#2#3#4\relax{%
\begingroup
\count0="#1 %
\loop
- \ifnum\count0<"#2 %
- \ifcsname #3\endcsname
- \global\Umathcode\count0=\csname #3\endcsname 1 \count0 %
+ \unless\ifnum\count0>"#2 %
+ \ifcsname mathclass#3\endcsname
+ \global\Umathcode\count0=\csname mathclass#3\endcsname 1 \count0 %
\fi
\advance\count0 by 1 %
\repeat
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