[latex3-commits] [git/LaTeX3-latex3-latex2e] master: Revert "Revert "babel 3.25. Improved Thai, Lao, Khmer. Fix error with mapfont=directions."" (ef25c65)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Oct 6 09:50:47 CEST 2018
Repository : https://github.com/latex3/latex2e
On branch : master
Link : https://github.com/latex3/latex2e/commit/ef25c6594bb76e42f33d41b109f16ec7112289f9
>---------------------------------------------------------------
commit ef25c6594bb76e42f33d41b109f16ec7112289f9
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Oct 6 08:50:47 2018 +0100
Revert "Revert "babel 3.25. Improved Thai, Lao, Khmer. Fix error with mapfont=directions.""
This reverts commit 2238ea6b4d8e173bc9d145d848dcffd940d4bb87.
>---------------------------------------------------------------
ef25c6594bb76e42f33d41b109f16ec7112289f9
required/babel/README.md | 8 ++-
required/babel/babel.dtx | 83 ++++++++++++++++++++++++------
required/babel/babel.ins | 2 +-
required/babel/babel.pdf | Bin 658776 -> 658893 bytes
required/babel/bbcompat.dtx | 2 +-
required/babel/locale/km/babel-khmer.tex | 19 +++++++
required/babel/locale/km/babel-km.ini | 5 +-
required/babel/locale/lo/babel-lao.tex | 11 ++++
required/babel/locale/lo/babel-lo.ini | 5 +-
required/babel/locale/th/babel-thai.tex | 4 +-
required/babel/samples/lua-arabic.pdf | Bin 85557 -> 85142 bytes
required/babel/samples/lua-arabic.tex | 12 -----
required/babel/samples/lua-bidibasic.pdf | Bin 49310 -> 49308 bytes
required/babel/samples/lua-bidibasic.tex | 8 ++-
required/babel/samples/lua-secenum.pdf | Bin 57623 -> 57618 bytes
required/babel/samples/lua-thai.pdf | Bin 36155 -> 36098 bytes
16 files changed, 115 insertions(+), 44 deletions(-)
diff --git a/required/babel/README.md b/required/babel/README.md
index 94bb78d..4b6f760 100644
--- a/required/babel/README.md
+++ b/required/babel/README.md
@@ -1,4 +1,4 @@
-## Babel 3.24
+## Babel 3.25
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -51,6 +51,10 @@ respective authors.
### Latest changes
```
+3.25 - Fixes for 3.23 - mapfont=direction could raise an error.
+ Language and Script were not always defined correctly.
+ - Improved tentative support for Thai, Lao and Khmer in both
+ luatex and xetex.
3.24 - Prelimimary support for Thai interword spacing with luatex.
3.23 - After extensive tests and fixing some issues, bidi=basic is
not experimental any longer.
@@ -110,5 +114,5 @@ respective authors.
```
Javier Bezos
-2018/09/26
+2018/10/03
diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index 49c55ac..5bc0f3f 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -31,7 +31,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2018/09/26 v3.24 The Babel package]
+\ProvidesFile{babel.dtx}[2018/10/03 v3.25 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -3857,8 +3857,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.24>>
-%<<date=2018/09/26>>
+%<<version=3.25>>
+%<<date=2018/10/03>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -7739,6 +7739,8 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl at KVP@hyphenrules\@nil
\let\bbl at KVP@mapfont\@nil
\let\bbl at KVP@maparabic\@nil
+ \let\bbl at KVP@intraspace\@nil
+ \let\bbl at KVP@intrapenalty\@nil
\bbl at forkv{#1}{\bbl at csarg\def{KVP@##1}{##2}}% TODO - error handling
\ifx\bbl at KVP@import\@nil\else
\bbl at exp{\\\bbl at ifblank{\bbl at KVP@import}}%
@@ -7770,12 +7772,14 @@ help from Bernd Raichle, for which I am grateful.
\\\foreignlanguage{\languagename}%
{####1}}}}%
{}%
+ % To override script and language names
\ifx\bbl at KVP@script\@nil\else
\bbl at csarg\edef{sname@#2}{\bbl at KVP@script}%
\fi
\ifx\bbl at KVP@language\@nil\else
\bbl at csarg\edef{lname@#2}{\bbl at KVP@language}%
\fi
+ % For bidi texts, to switch the language based on direction
\ifx\bbl at KVP@mapfont\@nil\else
\bbl at ifsamestring{\bbl at KVP@mapfont}{direction}{}%
{\bbl at error{Option `\bbl at KVP@mapfont' unknown for\\%
@@ -7791,13 +7795,16 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl at mapselect\relax
\edef\bbl at prefontid{\fontid\font}}%
\def\bbl at mapdir##1{%
- {\def\languagename{##1}\bbl at switchfont
+ {\def\languagename{##1}%
+ \let\bbl at ifrestoring\@firstoftwo % avoid font warning
+ \bbl at switchfont
\directlua{Babel.fontmap
[\the\csname bbl at wdir@##1\endcsname]%
[\bbl at prefontid]=\fontid\font}}}%
\fi
\bbl at exp{\\\bbl at add\\\bbl at mapselect{\\\bbl at mapdir{\languagename}}}%
\fi
+ % For Southeast Asian, if interspace in ini
\ifcase\bbl at engine\or
\bbl at ifunset{bbl at intsp@\languagename}{}%
{\expandafter\ifx\csname bbl at intsp@\languagename\endcsname\@empty\else
@@ -7823,8 +7830,30 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\bbl at intrapenalty\bbl at KVP@intrapenalty\@@
\fi}%
\or
- %% TODO - xetex
+ \bbl at ifunset{bbl at intsp@\languagename}{}%
+ {\expandafter\ifx\csname bbl at intsp@\languagename\endcsname\@empty\else
+ \ifx\bbl at KVP@intraspace\@nil
+ \bbl at exp{%
+ \\\bbl at intraspace\bbl at cs{intsp@\languagename}\\\@@}%
+ \fi
+ \ifx\bbl at KVP@intrapenalty\@nil
+ \bbl at intrapenalty0\@@
+ \fi
+ \fi
+ \ifx\bbl at KVP@intraspace\@nil\else % We may override the ini
+ \expandafter\bbl at intraspace\bbl at KVP@intraspace\@@
+ \fi
+ \ifx\bbl at KVP@intrapenalty\@nil\else
+ \expandafter\bbl at intrapenalty\bbl at KVP@intrapenalty\@@
+ \fi
+ \ifx\bbl at ispacesize\@undefined
+ \AtBeginDocument{%
+ \expandafter\bbl at add
+ \csname selectfont \endcsname{\bbl at ispacesize}}%
+ \def\bbl at ispacesize{\bbl at cs{xeisp@\bbl at cs{sbcp@\languagename}}}%
+ \fi}%
\fi
+ % Native digits, if provided in ini
\ifcase\bbl at engine\else
\bbl at ifunset{bbl at dgnat@\languagename}{}%
{\expandafter\ifx\csname bbl at dgnat@\languagename\endcsname\@empty\else
@@ -7841,6 +7870,7 @@ help from Bernd Raichle, for which I am grateful.
\fi
\fi}%
\fi
+ % To load or reaload the babel-*.tex, if require.babel in ini
\bbl at ifunset{bbl at rqtex@\languagename}{}%
{\expandafter\ifx\csname bbl at rqtex@\languagename\endcsname\@empty\else
\let\BabelBeforeIni\@gobbletwo
@@ -7851,6 +7881,13 @@ help from Bernd Raichle, for which I am grateful.
\let\atcatcode\relax
\fi}%
\let\languagename\bbl at savelangname}
+% \end{macrocode}
+%
+% A tool to define the macros for native digits from the list provided
+% in the |ini| file. Somewhat convoluted because there are 10 digits,
+% but only 9 arguments in \TeX.
+%
+% \begin{macrocode}
\def\bbl at setdigits#1#2#3#4#5{%
\bbl at exp{%
\def\<\languagename digits>####1{% ie, \langdigits
@@ -8217,13 +8254,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl at csarg\bbl at add@list{lsys@#1}{Script=\bbl at cs{sname@#1}}%
\bbl at ifunset{bbl at lname@#1}{}%
{\bbl at csarg\bbl at add@list{lsys@#1}{Language=\bbl at cs{lname@#1}}}%
- \bbl at csarg\bbl at toglobal{lsys@#1}%
- \bbl at exp{% TODO - should be global, but even local does its job
- % I'm still not sure -- must investigate
- \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl at cs{sname@#1}}%
- {\\\newfontscript{\bbl at cs{sname@#1}}{\bbl at cs{sotf@#1}}}%
- \<keys_if_exist:nnF>{fontspec-opentype}{Language/\bbl at cs{lname@#1}}%
- {\\\newfontlanguage{\bbl at cs{lname@#1}}{\bbl at cs{lotf@#1}}}}}
+ \bbl at csarg\bbl at toglobal{lsys@#1}}
% \end{macrocode}
%
% The following |ini| reader ignores everything but the
@@ -10679,10 +10710,11 @@ help from Bernd Raichle, for which I am grateful.
\ifx\fontspec\@undefined
\usepackage{fontspec}%
\fi
- \EnableBabelHook{babel-fontspec}%
+ \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
\bbl at bblfont}
\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname
\bbl at ifunset{\bbl at tempb family}{\bbl at providefam{\bbl at tempb}}{}%
+ % For the default font, just in case:
\bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
\expandafter\bbl at ifblank\expandafter{\bbl at tempa}%
{\bbl at csarg\edef{\bbl at tempb dflt@}{<>{#1}{#2}}% save bbl at rmdflt@
@@ -10731,8 +10763,9 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl at tempa{%
\bbl at warning{The current font is not a standard family:\\%
\fontname\font\\%
- Script and Language are not applied. Consider defining a\\%
- new family with \string\babelfont. Reported}}%
+ Script and Language are not applied. Consider\\%
+ defining a new family with \string\babelfont.\\%
+ Reported}}%
\bbl at foreach\bbl at font@fams{% don't gather with prev for
\bbl at ifunset{bbl@##1dflt@\languagename}%
{\bbl at cs{famrst@##1}%
@@ -10766,8 +10799,18 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl at fontspec@set#1#2#3{% eg \bbl at rmdflt@lang fnt-opt fnt-nme
\let\bbl at tempe\bbl at mapselect
\let\bbl at mapselect\relax
- \bbl at exp{\<fontspec_set_family:Nnn>\\#1%
- {\bbl at cs{lsys@\languagename},#2}}{#3}%
+ \bbl at exp{% TODO - should be global, but even local does its job
+ % I'm still not sure -- must investigate
+ \<keys_if_exist:nnF>{fontspec-opentype}%
+ {Script/\bbl at cs{sname@\languagename}}%
+ {\\\newfontscript{\bbl at cs{sname@\languagename}}%
+ {\bbl at cs{sotf@\languagename}}}%
+ \<keys_if_exist:nnF>{fontspec-opentype}%
+ {Language/\bbl at cs{lname@\languagename}}%
+ {\\\newfontlanguage{\bbl at cs{lname@\languagename}}%
+ {\bbl at cs{lotf@\languagename}}}%
+ \<fontspec_set_family:Nnn>\\#1%
+ {\bbl at cs{lsys@\languagename},#2}}{#3}% ie \bbl at exp{..}{#3}
\let\bbl at mapselect\bbl at tempe
\bbl at toglobal#1}%
% \end{macrocode}
@@ -10961,6 +11004,12 @@ help from Bernd Raichle, for which I am grateful.
\AddBabelHook{xetex}{stopcommands}{%
\xebbl at stop
\let\xebbl at stop\relax}
+\def\bbl at intraspace#1 #2 #3\@@{%
+ \bbl at csarg\gdef{xeisp@\bbl at cs{sbcp@\languagename}}%
+ {\XeTeXlinebreakskip #1em plus #2em minus #3em\relax}}
+\def\bbl at intrapenalty#1\@@{%
+ \bbl at csarg\gdef{xeipn@\bbl at cs{sbcp@\languagename}}%
+ {\XeTeXlinebreakpenalty #1\relax}}
\AddBabelHook{xetex}{loadkernel}{%
<@Restore Unicode catcodes before loading patterns@>}
\ifx\DisableBabelHook\@undefined\endinput\fi
diff --git a/required/babel/babel.ins b/required/babel/babel.ins
index 01cfbb6..c166c12 100644
--- a/required/babel/babel.ins
+++ b/required/babel/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2018/09/26}
+\def\filedate{2018/10/03}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index 6ca3918..a3923e4 100644
Binary files a/required/babel/babel.pdf and b/required/babel/babel.pdf differ
diff --git a/required/babel/bbcompat.dtx b/required/babel/bbcompat.dtx
index 4f65cc2..b5a5ca8 100644
--- a/required/babel/bbcompat.dtx
+++ b/required/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2018/09/26 v3.24]
+\ProvidesFile{bbcompat.dtx}[2018/10/03 v3.25]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/required/babel/locale/km/babel-khmer.tex b/required/babel/locale/km/babel-khmer.tex
index f8cf086..5c4dbb8 100644
--- a/required/babel/locale/km/babel-khmer.tex
+++ b/required/babel/locale/km/babel-khmer.tex
@@ -9,4 +9,23 @@
\fi
\BabelBeforeIni{km}{%
}
+
+\addto\datekhmer{%
+ \babel at save\BabelDated
+ \def\BabelDated#1{{\expandafter\khmerdigits\expandafter{#1}}}%
+ \babel at save\BabelDatey
+ \def\BabelDatey#1{{\expandafter\khmerdigits\expandafter{#1}}}}
+
+\ifcase\bbl at engine\or\or
+ \bbl at tentative{khmer}%
+ \bbl at add\extraskhmer{%
+ \XeTeXlinebreaklocale "kh"
+ \bbl at xeisp@Khmr
+ \bbl at xeipn@Khmr
+ }
+ \bbl at add\noextraskhmer{%
+ \XeTeXlinebreaklocale "en"
+ }
+\fi
+
\endinput
diff --git a/required/babel/locale/km/babel-km.ini b/required/babel/locale/km/babel-km.ini
index 701fe38..e1982e2 100644
--- a/required/babel/locale/km/babel-km.ini
+++ b/required/babel/locale/km/babel-km.ini
@@ -11,8 +11,8 @@
[identification]
charset = utf8
-version = 1.2
-date = 2018-09-07
+version = 1.3
+date = 2018-10-02
name.local = ខ្មែរ
name.english = Khmer
name.babel = khmer
@@ -24,6 +24,7 @@ script.tag.opentype = khmr
level = 1
encodings =
derivate = no
+require.babel = khmer
[captions]
preface = អារម្ភកថា
diff --git a/required/babel/locale/lo/babel-lao.tex b/required/babel/locale/lo/babel-lao.tex
index d2d995f..1783501 100644
--- a/required/babel/locale/lo/babel-lao.tex
+++ b/required/babel/locale/lo/babel-lao.tex
@@ -9,4 +9,15 @@
\fi
\BabelBeforeIni{lo}{%
}
+
+\ifcase\bbl at engine\or\or
+ \bbl at tentative{lao}%
+ \addto\extraslao{%
+ \XeTeXlinebreaklocale "lo"
+ \bbl at xeisp@Laoo
+ \bbl at xeipn@Laoo}
+ \addto\noextraslao{%
+ \XeTeXlinebreaklocale "en"}
+\fi
+
\endinput
diff --git a/required/babel/locale/lo/babel-lo.ini b/required/babel/locale/lo/babel-lo.ini
index 255e260..885852c 100644
--- a/required/babel/locale/lo/babel-lo.ini
+++ b/required/babel/locale/lo/babel-lo.ini
@@ -11,8 +11,8 @@
[identification]
charset = utf8
-version = 1.2
-date = 2018-09-07
+version = 1.3
+date = 2018-10-02
name.local = ລາວ
name.english = Lao
name.babel = lao
@@ -24,6 +24,7 @@ script.tag.opentype = lao
level = 1
encodings =
derivate = no
+require.babel = lao
[captions]
preface = ຄໍານໍາ
diff --git a/required/babel/locale/th/babel-thai.tex b/required/babel/locale/th/babel-thai.tex
index 994b33f..c3a6b8c 100644
--- a/required/babel/locale/th/babel-thai.tex
+++ b/required/babel/locale/th/babel-thai.tex
@@ -16,10 +16,10 @@
\ifcase\bbl at engine\or\or
\bbl at tentative{thai}%
- % \XeTeXlinebreakskip should be reset with \fontsize
\addto\extrasthai{%
\XeTeXlinebreaklocale "th"
- \XeTeXlinebreakskip 0em plus .1em}
+ \bbl at xeisp@Thai
+ \bbl at xeipn@Thai}
\addto\noextrasthai{%
\XeTeXlinebreaklocale "en"}
\fi
diff --git a/required/babel/samples/lua-arabic.pdf b/required/babel/samples/lua-arabic.pdf
index 7cc4f0f..ad77365 100644
Binary files a/required/babel/samples/lua-arabic.pdf and b/required/babel/samples/lua-arabic.pdf differ
diff --git a/required/babel/samples/lua-arabic.tex b/required/babel/samples/lua-arabic.tex
index c066af8..e9dd838 100644
--- a/required/babel/samples/lua-arabic.tex
+++ b/required/babel/samples/lua-arabic.tex
@@ -19,11 +19,6 @@
\usepackage{multicol}
\usepackage{booktabs}
-% The following package provides a few workarounds for a bug in the
-% lua font loader, which sometimes inserts kerns at the wrong place.
-% It's just a workaround, so it's only available on GitHub.
-\usepackage{fixarabkerns}
-
\title{كهرباء}
\author{From Wikipedia\\%
Typeset with \textsf{babel}
@@ -75,13 +70,6 @@
استخدام الطاقة الكهربائية، ويمكن التكهن بأن الاعتماد على الطاقة
الكهربائية سيستمر في المستقبل.
-\bigskip
-
-\foreignlanguage*{english}{Below, in red, a couple of words
-incorrectly rendered by default in the corrent font. It seems a bug in
-the font loader, and a workaround is used in this document (see the
-source).}
-
\mainmatter
\chapter{نظرة عامة}
diff --git a/required/babel/samples/lua-bidibasic.pdf b/required/babel/samples/lua-bidibasic.pdf
index e2ef5e3..94dda04 100644
Binary files a/required/babel/samples/lua-bidibasic.pdf and b/required/babel/samples/lua-bidibasic.pdf differ
diff --git a/required/babel/samples/lua-bidibasic.tex b/required/babel/samples/lua-bidibasic.tex
index 14cb685..b4085ac 100644
--- a/required/babel/samples/lua-bidibasic.tex
+++ b/required/babel/samples/lua-bidibasic.tex
@@ -6,12 +6,10 @@
\usepackage[spanish, english, bidi=basic]{babel}
-% Define two new languages:
-
-% \babelprovide[mapfont=direction]{english} %
-\babelprovide[import=ar,mapfont=direction]{arabic}
+% \babelprovide[mapfont=direction]{english}
+\babelprovide[import,mapfont=direction]{arabic}
\babelprovide[import=fa]{farsi}
-\babelprovide[import=he,mapfont=direction]{hebrew}
+\babelprovide[import,mapfont=direction]{hebrew}
\babelfont{rm}{Crimson}
\babelfont[*arabic]{rm}
diff --git a/required/babel/samples/lua-secenum.pdf b/required/babel/samples/lua-secenum.pdf
index ea40b57..42eec82 100644
Binary files a/required/babel/samples/lua-secenum.pdf and b/required/babel/samples/lua-secenum.pdf differ
diff --git a/required/babel/samples/lua-thai.pdf b/required/babel/samples/lua-thai.pdf
index 37f7797..9bc973d 100644
Binary files a/required/babel/samples/lua-thai.pdf and b/required/babel/samples/lua-thai.pdf differ
More information about the latex3-commits
mailing list