[latex3-commits] [git/LaTeX3-latex3-latex2e] master: Prelimimary support for Thai interword spacing with luatex. (b9ea43d)

Javier javier at dante.de
Wed Sep 26 18:20:46 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/b9ea43df0d3f10e65e91ca4cbbef0bf6a7257640

>---------------------------------------------------------------

commit b9ea43df0d3f10e65e91ca4cbbef0bf6a7257640
Author: Javier <javier at localhost>
Date:   Wed Sep 26 18:19:31 2018 +0200

    Prelimimary support for Thai interword spacing with luatex.


>---------------------------------------------------------------

b9ea43df0d3f10e65e91ca4cbbef0bf6a7257640
 required/babel/README.md                |   22 +--
 required/babel/babel.dtx                |  274 +++++++++++++++++++++----------
 required/babel/babel.ins                |    2 +-
 required/babel/babel.pdf                |  Bin 653584 -> 658776 bytes
 required/babel/bbcompat.dtx             |    2 +-
 required/babel/locale/km/babel-km.ini   |   49 +++---
 required/babel/locale/lo/babel-lo.ini   |    7 +-
 required/babel/locale/th/babel-th.ini   |   11 +-
 required/babel/locale/th/babel-thai.tex |   15 ++
 required/babel/samples/lua-thai.pdf     |  Bin 36019 -> 36155 bytes
 required/babel/samples/lua-thai.tex     |    4 +-
 11 files changed, 246 insertions(+), 140 deletions(-)

diff --git a/required/babel/README.md b/required/babel/README.md
index b55f401..94bb78d 100644
--- a/required/babel/README.md
+++ b/required/babel/README.md
@@ -1,4 +1,4 @@
-## Babel 3.23.1391
+## Babel 3.24
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -7,21 +7,6 @@ lualatex out of the box.  A few even work with plain formats.
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Version 3.9a fixed lots of bugs and added some new features, intended
-mainly to make it compatible somehow with Unicode engines. Some bugs
-have not been fixed to avoid backward incompatibilities, but they have
-been documented. Most of the new features (like package options) were
-intended to overcome issues in previous releases without changing
-significantly the behaviour of Babel.
-
-Current development is focused on Unicode engines (XeTeX and LuaTeX).
-New features related to font selection, bidi writing and the like will
-be added incrementally. Versions numbers drop the letter and now 3.10,
-3.11, etc., will be used instead. So, 3.9t is the last in the former
-series.
-
-Included is a set of ini files for about 200 languages.
-
 Languages are not part of the Babel core any more; in particular, it
 shall be no longer necessary to synchronize Babel core releases with
 releases of Babel language files. See CONTRIB for further details
@@ -29,6 +14,8 @@ about contributing a language. You may also create an ini file or
 improve the existing ones -- it's a trivial task (no programming
 skills required at all), but don't hesitate to ask for help.
 
+Included is a set of ini files for about 200 languages.
+
 The best way to install and/or update it is with the help of package
 managers.
 
@@ -64,6 +51,7 @@ respective authors.
 ### Latest changes
 
 ```
+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.
        - import in \babelprovide does not require a language code if
@@ -122,5 +110,5 @@ respective authors.
 ```
 
 Javier Bezos
-2018/09/06
+2018/09/26
 
diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index d3a374f..49c55ac 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2018/09/06 v3.23.1391 The Babel package]
+\ProvidesFile{babel.dtx}[2018/09/26 v3.24 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2071,6 +2071,35 @@ language name to be used by \textsf{fontspec} (eg, |Hindi|). Overrides
 the value in the |ini| file. Not so important, but sometimes still
 relevant.
 
+\bigskip
+
+A few options (only \luatex) set some properties of the writing system
+used by the language. These properties are \textit{always} applied to
+the script, no matter which language is active. Although somewhat
+inconsistent, this makes setting a language up easier in most typical
+cases.
+
+\Describe{mapfont=}{\texttt{direction}}
+Assigns the font for the writing direction of this language. More
+precisely, what |mapfont=direction| means is, ‘when a character has the
+same direction as the script for the “provided” language, then change
+its font to that set for this language’. There are 3 directions,
+following the bidi Unicode algorithm, namely, Arabic-like, Hebrew-like
+and left to right.\footnote{In future realeases an new value 
+(\texttt{script}) will be added.} So, there should be at most 3 
+directives of this kind.
+
+\Describe{intraspace=}{\meta{base} \meta{shrink} \meta{stretch}}
+Sets the interword space for the writing system of the language, in em
+units (so, |0 .1 0| is |0em plus .1em|). Like |\spaceskip|, the em unit
+applied is that of the current text (more precisely, the previous 
+glyph). Currently used only in Southeast Asian scrips, like Thai.
+
+\Describe{intrapenalty}{\meta{penalty}}
+Sets the interword penalty for the writing system of this language.
+Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
+(which is the default value).
+
 \begin{note}
   (1) If you need shorthands, you can use |\useshorthands| and
   |\defineshorthand| as described above. (2) Captions and |\today| are
@@ -2216,7 +2245,14 @@ Listed words are saved expanded and therefore it relies on the
 LICR. Of course, it also works without the LICR if the input and the
 font encodings are the same, like in Unicode based engines.
 
-\Describe\babelpatterns{\texttt{[}\langlist\texttt{]}%
+\begin{note}
+  Using |\babelhyphenation| with Southeast Asian scripts is mostly
+  pointless. But with |\babelpatterns| (below) you may fine-tune line
+  breaking (only \luatex). Even if there are no pattern for the
+  language, you can add at least some typical cases.
+\end{note}
+
+\Describe{\babelpatterns}{\texttt{[}\langlist\texttt{]}%
     \marg{patterns}}
 
 \New{3.9m} \textit{In \textsf{luatex} only},\footnote{With
@@ -2400,12 +2436,10 @@ _\babelprovide[import, main]{arabic}_
   \end{document}
   \end{verbatim}
   \endgroup
-  What |mapfont=direction| means is, ‘when a character has the same
-  direction as the script for the “provided” language (|arabic| in
-  this case), then change its font to that set for this language’ (here
-  defined via |*arabic|, because Crimson does not provide Arabic
-  letters). Note Hebrew and Arabic, following the Unicode rules, have
-  different directions (internally ‘r’ and ‘al’, respectively).
+  In this example, and thanks to |mapfont=direction|, any Arabic letter
+  (because the language is |arabic|) changes its font to that set for
+  this language (here defined via |*arabic|, because Crimson does not
+  provide Arabic letters).
 \end{example}
 
 \begin{note}
@@ -2878,15 +2912,10 @@ chapters), in Hungarian ``from (1)'' is ``(1)-b\H{o}l'', but ``from
 
 \textbf{Southeast Asian interword spacing}
 
-There is some rudimentary interword spacing for Thai, Lao and Khemer
+There is some preliminary interword spacing for Thai, Lao and Khemer
 in \luatex{} (provided there are hyphenation patters). It is activated
 automatically if a language with of one of these scripts are loaded
-with |\babelprovide|. They are just the first steps. See the sample on 
-the \babel{} repository.
-
-Note you can easily add, modify and remove patterns with 
-|\babelpatterns|. Even if there are no pattern for the language, you 
-can add at least some typical cases.
+with |\babelprovide|. See the sample on the \babel{} repository.
 
 \medskip
 \textbf{Old stuff}
@@ -3828,8 +3857,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.23.1391>>
-%<<date=2018/09/06>>
+%<<version=3.24>>
+%<<date=2018/09/26>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -4398,6 +4427,7 @@ help from Bernd Raichle, for which I am grateful.
 \DeclareOption{noconfigs}{}
 \DeclareOption{showlanguages}{}
 \DeclareOption{silent}{}
+\DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
 <@More package options@>
 %    \end{macrocode}
@@ -6708,18 +6738,6 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{macro}
 %
-% \subsection{Interword spacing in Southeast Asian scripts}
-%
-% \textit{At work}.
-%
-%    \begin{macrocode}
-\def\bbl at seascripts{,Thai,Lao,Khmer,} % Malayalam?
-\newcommand\babelinterword[3]{%
-  \def\BabelInterword{#1}%
-  \def\BabelInterwordStretch{#2}%
-  \def\BabelInterwordShrink{#3}}
-\babelinterword{0}{.1}{0}
-%    \end{macrocode}
 % \subsection{Multiencoding strings}
 %
 % \changes{babel~3.9a}{2012/09/05}{Added tentative code for string
@@ -7690,12 +7708,10 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \subsection{Creating languages}
 %
-% |\babelprovide| is a general purpose tool for creating
-% languages. Currently it just creates the language infrastructure,
-% but in the future it will be able to read data from |ini| files, as
-% well as to create variants. Unlike the \textsf{nil} pseudo-language,
-% captions are defined, but with a warning to invite the user to
-% provide the real string.
+% |\babelprovide| is a general purpose tool for creating and modifying
+% languages. It creates the language infrastructure, and
+% loads, if requested, an |ini| file. It may be used in conjunction to
+% previouly loaded |ldf| files.
 %
 % \changes{3.10}{2017/05/19}{Added \cs{babelprovide}}
 % \changes{3.13}{2017/08/30}{Added \cs{import}, which also reads
@@ -7735,6 +7751,7 @@ help from Bernd Raichle, for which I am grateful.
   \ifx\bbl at KVP@captions\@nil
     \let\bbl at KVP@captions\bbl at KVP@import
   \fi
+  % Load ini
   \bbl at ifunset{date#2}%
     {\bbl at provide@new{#2}}%
     {\bbl at ifblank{#1}%
@@ -7745,6 +7762,7 @@ help from Bernd Raichle, for which I am grateful.
          import=lang-tag}%
         {Use this macro as documented}}%
       {\bbl at provide@renew{#2}}}%
+  % Post tasks
   \bbl at exp{\\\babelensure[exclude=\\\today]{#2}}%
   \bbl at ifunset{bbl at ensure@\languagename}%
     {\bbl at exp{%
@@ -7780,6 +7798,33 @@ help from Bernd Raichle, for which I am grateful.
     \fi
     \bbl at exp{\\\bbl at add\\\bbl at mapselect{\\\bbl at mapdir{\languagename}}}%
   \fi
+  \ifcase\bbl at engine\or
+    \bbl at ifunset{bbl at intsp@\languagename}{}%
+      {\expandafter\ifx\csname bbl at intsp@\languagename\endcsname\@empty\else
+        \bbl at seaintraspace
+        \ifx\bbl at KVP@intraspace\@nil
+           \bbl at exp{%
+             \\\bbl at intraspace\bbl at cs{intsp@\languagename}\\\@@}%
+        \fi
+        \directlua{
+           Babel = Babel or {}
+           Babel.sea_ranges = Babel.sea_ranges or {}
+           Babel.set_chranges('\bbl at cs{sbcp@\languagename}', 
+                              '\bbl at cs{chrng@\languagename}')
+        }
+        \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}%
+  \or 
+    %% TODO - xetex
+  \fi
   \ifcase\bbl at engine\else
     \bbl at ifunset{bbl at dgnat@\languagename}{}%
       {\expandafter\ifx\csname bbl at dgnat@\languagename\endcsname\@empty\else
@@ -7796,6 +7841,15 @@ help from Bernd Raichle, for which I am grateful.
         \fi
       \fi}%
   \fi
+  \bbl at ifunset{bbl at rqtex@\languagename}{}%
+    {\expandafter\ifx\csname bbl at rqtex@\languagename\endcsname\@empty\else
+       \let\BabelBeforeIni\@gobbletwo
+       \chardef\atcatcode=\catcode`\@
+       \catcode`\@=11\relax
+       \InputIfFileExists{babel-\bbl at cs{rqtex@\languagename}.tex}{}{}%
+       \catcode`\@=\atcatcode
+       \let\atcatcode\relax
+     \fi}%
   \let\languagename\bbl at savelangname}
 \def\bbl at setdigits#1#2#3#4#5{%
   \bbl at exp{%
@@ -8010,12 +8064,17 @@ help from Bernd Raichle, for which I am grateful.
   \bbl at exportkey{sbcp}{identification.script.tag.bcp47}{}%
   \bbl at exportkey{sotf}{identification.script.tag.opentype}{DFLT}}
 \let\bbl at secline@typography\bbl at inikv
+\let\bbl at secline@characters\bbl at inikv
 \let\bbl at secline@numbers\bbl at inikv
 \def\bbl at after@ini{%
   \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
   \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
   \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
+  \bbl at exportkey{intsp}{typography.intraspace}{}%
+  \bbl at exportkey{jstfy}{typography.justify}{w}%
+  \bbl at exportkey{chrng}{characters.ranges}{}%
   \bbl at exportkey{dgnat}{numbers.digits.native}{}%
+  \bbl at exportkey{rqtex}{identification.require.babel}{}%
   \bbl at xin@{0.5}{\@nameuse{bbl@@kv at identification.version}}%
   \ifin@
     \bbl at warning{%
@@ -8125,7 +8184,7 @@ help from Bernd Raichle, for which I am grateful.
        range 0-9999.}%
       {There is little you can do. Sorry.}%
   \fi\fi\fi\fi}}
-\newcommand\BabelDateyyyy[1]{{\number#1}}
+\newcommand\BabelDateyyyy[1]{{\number#1}} % FIXME - add leading 0
 \def\bbl at replace@finish at iii#1{%
   \bbl at exp{\def\\#1####1####2####3{\the\toks@}}}
 \def\bbl at TG@@date{%
@@ -8145,9 +8204,7 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 %
 % Language and Script values to be used when defining a font or
-% setting the direction are set with the following macros. It also 
-% activates interword spacing in Southeast Asian scripts if not done 
-% before.
+% setting the direction are set with the following macros.
 %
 %    \begin{macrocode}
 \def\bbl at provide@lsys#1{%
@@ -8161,10 +8218,6 @@ help from Bernd Raichle, for which I am grateful.
   \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 xin@{\csname bbl at sname@#1\endcsname}{\bbl at seascripts}%
-  \ifin@
-    \@nameuse{bbl at seainterword}%
-  \fi
   \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}}%
@@ -8453,25 +8506,21 @@ help from Bernd Raichle, for which I am grateful.
 %  \end{macro}
 %
 %  \begin{macro}{\bibcite}
-%    The macro that is used in the |.aux| file to define citation
-%    labels. When packages such as \pkg{natbib} or \pkg{cite} are not
-%    loaded its second argument is used to typeset the citation
-%    label. In that case, this second argument can contain active
-%    characters but is used in an environment where
-%    |\@safe at activestrue| is in effect. This switch needs to be reset
-%    inside the |\hbox| which contains the citation label. In order to
-%    determine during \file{.aux} file processing which definition of
-%    |\bibcite| is needed we define |\bibcite| in such a way that it
-%    redefines itself with the proper definition.
+%  The macro that is used in the |.aux| file to
+%  define citation labels. When packages such as \pkg{natbib} or
+%  \pkg{cite} are not loaded its second argument is used to typeset the
+%  citation label. In that case, this second argument can contain
+%  active characters but is used in an environment where
+%  |\@safe at activestrue| is in effect. This switch needs to be reset
+%  inside the |\hbox| which contains the citation label. In order to
+%  determine during \file{.aux} file processing which definition of
+%  |\bibcite| is needed we define |\bibcite| in such a way that it
+%  redefines itself with the proper definition. We call
+%  |\bbl at cite@choice| to select the proper definition for |\bibcite|.
+%  This new definition is then activated.
 %
 %    \begin{macrocode}
   \bbl at redefine\bibcite{%
-%    \end{macrocode}
-%
-%    We call |\bbl at cite@choice| to select the proper definition for
-%    |\bibcite|. This new definition is then activated.
-%
-%    \begin{macrocode}
     \bbl at cite@choice
     \bibcite}
 %    \end{macrocode}
@@ -8491,28 +8540,19 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \begin{macro}{\bbl at cite@choice}
 %    The macro |\bbl at cite@choice| determines which definition of
-%    |\bibcite| is needed.
+%    |\bibcite| is needed. First we give |\bibcite| its default
+%    definition.
 %
 %    \begin{macrocode}
   \def\bbl at cite@choice{%
-%    \end{macrocode}
-%
-%    First we give |\bibcite| its default definition.
-%
-%    \begin{macrocode}
     \global\let\bibcite\bbl at bibcite
 %    \end{macrocode}
 %
 %    Then, when \pkg{natbib} is loaded we restore the original
-%    definition of |\bibcite|.
+%    definition of |\bibcite|. For \pkg{cite} we do the same.
 %
 %    \begin{macrocode}
     \@ifpackageloaded{natbib}{\global\let\bibcite\org at bibcite}{}%
-%    \end{macrocode}
-%
-%    For \pkg{cite} we do the same.
-%
-%    \begin{macrocode}
     \@ifpackageloaded{cite}{\global\let\bibcite\org at bibcite}{}%
 %    \end{macrocode}
 %
@@ -10135,6 +10175,13 @@ help from Bernd Raichle, for which I am grateful.
     it in the preamble with something like:\\%
     \string\renewcommand\@backslashchar#2{..}\\%
     Reported}}
+\def\bbl at tentative{\protect\bbl at tentative@i}
+\def\bbl at tentative@i#1{%
+  \bbl at warning{%
+    Some functions in '#1' are tentative.\\%
+    They might not work as expected and their behavior\\%
+    could change in the future.\\%
+    Reported}}
 \def\@nolanerr#1{%
   \bbl at error
     {You haven't defined the language #1\space yet}%
@@ -11482,35 +11529,79 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \section{Southeast Asian scripts}
 %
+% \changes{babel~3.24}{2018/09/24}{Lua code for interword spacing
+%   in Southeast Asian scripts.}
+%
+% \textit{In progress.} Replace regular (ie, implicit) discretionaries
+% by spaceskips, based on the previous glyph (which I think makes
+% sense, because the hyphen and the previous char go always together).
+% Other discretionaries are not touched.
+%
+% For the moment, only 3 SA languages are 
+% activated by default (see Unicode UAX 14).
+%
 %    \begin{macrocode}
-\def\bbl at seainterword{
-  \let\bbl at seainterword\relax
+\def\bbl at intraspace#1 #2 #3\@@{%
   \directlua{
     Babel = Babel or {}
+    Babel.intraspaces = Babel.intraspaces or {}
+    Babel.intraspaces['\csname bbl at sbcp@\languagename\endcsname'] = %
+       {b = #1, p = #2, m = #3}
+  }}
+\def\bbl at intrapenalty#1\@@{%
+  \directlua{
+    Babel = Babel or {}
+    Babel.intrapenalties = Babel.intrapenalties or {}
+    Babel.intrapenalties['\csname bbl at sbcp@\languagename\endcsname'] = #1
+  }}
+\begingroup
+\catcode`\%=12
+\catcode`\^=14
+\catcode`\'=12
+\catcode`\~=12
+\gdef\bbl at seaintraspace{^
+  \let\bbl at seaintraspace\relax
+  \directlua{
+    Babel = Babel or {}
+    Babel.sea_ranges = Babel.sea_ranges or {}
+    function Babel.set_chranges (script, chrng) 
+      local c = 0
+      for s, e in string.gmatch(chrng..' ', '(.-)%.%.(.-)%s') do
+        Babel.sea_ranges[script..c]={tonumber(s,16), tonumber(e,16)}
+        c = c + 1
+      end
+    end
     function Babel.sea_disc_to_space (head)
-      local useinterword = false
-      local size = 10
+      local sea_ranges = Babel.sea_ranges
+      local last_char = nil
+      local quad = 655360      ^^ 10 pt = 655360 = 10 * 65536
       for item in node.traverse(head) do
         local i = item.id
         if i == node.id'glyph' then
-          f = font.getfont(item.font)
-          size = f.size   %% 10 pt = 655360 = 10 * 65536
-          if (item.char > 0x0E00 and item.char < 0x0E7F) or   % Thai
-             (item.char > 0x0E80 and item.char < 0x0EFF) or   % Lao
-             (item.char > 0x1780 and item.char < 0x17FF) then % Khemer
-            useinterword = true
-          else
-            useinterword = false
+          last_char = item
+        elseif i == 7 and item.subtype == 3 and last_char 
+            and last_char.char > 0x0C99 then
+          quad = font.getfont(last_char.font).size
+          for lg, rg in pairs(sea_ranges) do
+            if last_char.char > rg[1] and last_char.char < rg[2] then
+              lg = lg:sub(1, 4)
+              local intraspace = Babel.intraspaces[lg]
+              local intrapenalty = Babel.intrapenalties[lg]
+              local n
+              if intrapenalty ~= 0 then
+                n = node.new(14, 0)     ^^ penalty
+                n.penalty = intrapenalty
+                node.insert_before(head, item, n)
+              end    
+              n = node.new(12, 13)      ^^ (glue, spaceskip)
+              node.setglue(n, intraspace.b * quad,
+                              intraspace.p * quad,
+                              intraspace.m * quad)
+              node.insert_before(head, item, n)
+              node.remove(head, item)
+            end
           end
         end
-        if i == 7 and item.subtype == 3 and useinterword then
-          local n = node.new(12, 13)
-          node.setglue(n, \BabelInterword * size,
-                          \BabelInterwordStretch * size,
-                          \BabelInterwordShrink * size)
-          node.insert_before(head, item, n)
-          node.remove(head, item)
-        end
       end
     end
     luatexbase.add_to_callback('hyphenate',
@@ -11520,6 +11611,7 @@ help from Bernd Raichle, for which I am grateful.
       end,
       'Babel.sea_disc_to_space')
 }}
+\endgroup
 %    \end{macrocode}
 %
 % Common stuff.
diff --git a/required/babel/babel.ins b/required/babel/babel.ins
index bd1f7ae..01cfbb6 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/06}
+\def\filedate{2018/09/26}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index 63e9937..6ca3918 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 f62dcba..4f65cc2 100644
--- a/required/babel/bbcompat.dtx
+++ b/required/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2018/09/06 v3.23.1391]
+\ProvidesFile{bbcompat.dtx}[2018/09/26 v3.24]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/required/babel/locale/km/babel-km.ini b/required/babel/locale/km/babel-km.ini
index 617ecd2..701fe38 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.1
-date = 2018-04-11
+version = 1.2
+date = 2018-09-07
 name.local = ខ្មែរ
 name.english = Khmer
 name.babel = khmer
@@ -26,27 +26,27 @@ encodings =
 derivate = no
 
 [captions]
-preface = 
-ref = 
-abstract = 
-bib = 
-chapter = 
-appendix = 
-contents = 
-listfigure = 
-listtable = 
-index = 
-figure = 
-table = 
-part = 
-encl = 
-cc = 
-headto = 
-page = 
-see = 
-also = 
-proof = 
-glossary = 
+preface = អារម្ភកថា
+ref = ឯកសារយោង
+abstract = សង្ខេប
+bib = គន្ថនិទ្ទេស
+chapter = ជំពូក
+appendix = សេចក្ដីបន្ថែម
+contents = មាតិការ
+listfigure = បញ្ជីរូបភាព
+listtable = បញ្ជីតារាង
+index = សន្ទស្សន៍
+figure = រូប
+table = តារាង
+part = ផ្នែក
+encl = ឯកសារភ្ជាប់
+cc = ចម្លងជួន
+headto = ផ្ញើរទៅ
+page = ទំព័រ
+see = មើល
+also = មើលបន្ថែម
+proof = សម្រាយ
+glossary = សទានុក្រម
 
 [captions.licr]
 preface = 
@@ -142,8 +142,11 @@ exhyphenchar =
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
+justify = s
+intraspace = 0 .1 0
 
 [characters]
+ranges = 1780..17FF
 delimiters.quotes = “”‘’
 auxiliary = [\u17B4\u17B5\u200B \u17CC \u17CE \u17CF \u17D1 ឝ ឞ]
 exemplarCharacters = [\u17D0 ៈ \u17CB \u17C9 \u17CA \u17CD ក ខ គ ឃ ង ច ឆ ជ ឈ ញ ដ ឋ ឌ ឍ ណ ត ថ ទ ធ ន ប ផ ព ភ ម យ រ ឫ ឬ ល ឭ ឮ វ ស ហ ឡ អ {អា} ឥ ឦ ឧ {ឧក} ឩ ឪ ឯ ឰ ឱ ឲ ឳ ា \u17B7 \u17B8 \u17B9 \u17BA \u17BB \u17BC \u17BD ើ ឿ ៀ េ ែ ៃ ោ ៅ \u17C6 ះ \u17D2]
diff --git a/required/babel/locale/lo/babel-lo.ini b/required/babel/locale/lo/babel-lo.ini
index 6806fda..255e260 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.1
-date = 2018-04-11
+version = 1.2
+date = 2018-09-07
 name.local = ລາວ
 name.english = Lao
 name.babel = lao
@@ -119,8 +119,11 @@ exhyphenchar =
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
+justify = s
+intraspace = 0 .1 0
 
 [characters]
+ranges = 0E80..0EFF
 delimiters.quotes = “”‘’
 auxiliary = [\u200B ໐ ໑ ໒ ໓ ໔ ໕ ໖ ໗ ໘ ໙]
 exemplarCharacters = [\u0EC8 \u0EC9 \u0ECA \u0ECB \u0ECC \u0ECD ໆ ກ ຂ ຄ ງ ຈ ສ ຊ ຍ ດ ຕ ຖ ທ ນ ບ ປ ຜ ຝ ພ ຟ ມ ຢ ຣ ລ ວ ຫ ໜ ໝ ອ ຮ ຯ ະ \u0EB1 າ ຳ \u0EB4 \u0EB5 \u0EB6 \u0EB7 \u0EB8 \u0EB9 \u0EBB \u0EBC ຽ ເ ແ ໂ ໃ ໄ]
diff --git a/required/babel/locale/th/babel-th.ini b/required/babel/locale/th/babel-th.ini
index 3285804..9762713 100644
--- a/required/babel/locale/th/babel-th.ini
+++ b/required/babel/locale/th/babel-th.ini
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.1
-date = 2018-04-11
+version = 1.2
+date = 2018-09-07
 name.local = ไทย
 name.english = Thai
 name.babel = thai
@@ -24,6 +24,7 @@ script.tag.opentype = thai
 level = 1
 encodings = 
 derivate = no
+require.babel = thai
 
 [captions]
 preface = คำนำ
@@ -72,7 +73,8 @@ proof = \thaiPhoPhan\thaiSaraI\thaiSoSua\thaiChoChan\thaiSaraUu\space \thaiNoNu\
 glossary = 
 
 [date.gregorian]
-date.long = [d] [MMMM] [G] [y]
+; Should be [G] instead of พ.ศ.
+date.long = [d] [MMMM] พ.ศ. [y]
 date.short = [d]/[M]/[yy]
 months.wide.1 = มกราคม
 months.wide.2 = กุมภาพันธ์
@@ -156,8 +158,11 @@ exhyphenchar =
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
+justify = s
+intraspace = 0 .1 0
 
 [characters]
+ranges = 0E00..0E7F
 delimiters.quotes = “”‘’
 auxiliary = [\u200B]
 exemplarCharacters = [ฯ ๆ \u0E4E \u0E4C \u0E47 \u0E48 \u0E49 \u0E4A \u0E4B ก ข ฃ ค ฅ ฆ ง จ ฉ ช ซ ฌ ญ ฎ ฏ ฐ ฑ ฒ ณ ด ต ถ ท ธ น บ ป ผ ฝ พ ฟ ภ ม ย ร ฤ ล ฦ ว ศ ษ ส ห ฬ อ ฮ \u0E4D ะ \u0E31 า ๅ ำ \u0E34 \u0E35 \u0E36 \u0E37 \u0E38 \u0E39 เ แ โ ใ ไ \u0E3A]
diff --git a/required/babel/locale/th/babel-thai.tex b/required/babel/locale/th/babel-thai.tex
index 39c0741..994b33f 100644
--- a/required/babel/locale/th/babel-thai.tex
+++ b/required/babel/locale/th/babel-thai.tex
@@ -9,4 +9,19 @@
 \fi
 \BabelBeforeIni{th}{%
 }
+
+\addto\datethai{%
+  \babel at save\BabelDatey
+  \def\BabelDatey#1{{\number\numexpr#1+543}}}
+
+\ifcase\bbl at engine\or\or
+  \bbl at tentative{thai}%
+  % \XeTeXlinebreakskip should be reset with \fontsize
+  \addto\extrasthai{%
+    \XeTeXlinebreaklocale "th"
+    \XeTeXlinebreakskip 0em plus .1em}
+  \addto\noextrasthai{%
+    \XeTeXlinebreaklocale "en"}
+\fi
+
 \endinput
\ No newline at end of file
diff --git a/required/babel/samples/lua-thai.pdf b/required/babel/samples/lua-thai.pdf
index d9bffc4..37f7797 100644
Binary files a/required/babel/samples/lua-thai.pdf and b/required/babel/samples/lua-thai.pdf differ
diff --git a/required/babel/samples/lua-thai.tex b/required/babel/samples/lua-thai.tex
index 58d5115..5952c52 100644
--- a/required/babel/samples/lua-thai.tex
+++ b/required/babel/samples/lua-thai.tex
@@ -7,7 +7,6 @@
 \babelfont{rm}{FreeSerif}
 
 \usepackage{microtype}
-\babelinterword{0}{.1}{0}
 
 \begin{document}
 
@@ -40,6 +39,7 @@
 
 \bigskip
 
-Typeset with babel \csname bbl at version\endcsname.
+Typeset with luatex, babel \csname bbl at version\endcsname, and 
+microtype.
 
 \end{document}
\ No newline at end of file





More information about the latex3-commits mailing list