[latex3-commits] [git/LaTeX3-latex3-babel] master: Kashida - hboxes, vowels. Fix #134. Fix #110. (f962154)

Javier email at dante.de
Sat May 29 09:12:23 CEST 2021


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/f962154a8f88e44211fb2a3f57019958d97fe8e4

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

commit f962154a8f88e44211fb2a3f57019958d97fe8e4
Author: Javier <email at localhost>
Date:   Sat May 29 09:12:23 2021 +0200

    Kashida - hboxes, vowels. Fix #134. Fix #110.


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

f962154a8f88e44211fb2a3f57019958d97fe8e4
 README.md              |   7 +++--
 babel.dtx              |  83 +++++++++++++++++++++++++++++++------------------
 babel.ins              |   2 +-
 babel.pdf              | Bin 844281 -> 844145 bytes
 bbcompat.dtx           |   2 +-
 locale/ar/babel-ar.ini |   3 +-
 6 files changed, 62 insertions(+), 35 deletions(-)

diff --git a/README.md b/README.md
index b497faa..6bfec10 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.59.2384
+## Babel 3.59.2387
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages. Many
@@ -47,9 +47,12 @@ respective authors.
 ### Summary of Latest changes
 ```
 3.60   2021-05-21
-       * Fixed lists with justification=kashida/elongated.
+       * Improved justification=kashida/elongated: lists, hboxes,
+         vowelized texts.
        * Fixes:
          - Underfull \hbox with amsmath (#133)
+         - Error with global options (#134)
+         
        
 3.59   2021-05-16
        * Tentative kashida with user-definable rules (via transforms).
diff --git a/babel.dtx b/babel.dtx
index 9bc6cb6..17ac8b6 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -20,6 +20,7 @@
 %% This work has the LPPL maintenance status "maintained".
 %%
 %% The Current Maintainer of this work is Javier Bezos.
+
 %%
 %% The list of derived (unpacked) files belonging to the distribution
 %% and covered by LPPL is defined by the unpacking scripts (with
@@ -31,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2021/05/26 v3.59.2384 The Babel package]
+\ProvidesFile{babel.dtx}[2021/05/29 v3.59.2387 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -4967,8 +4968,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.59.2384>>
-%<<date=2021/05/26>>
+%<<version=3.59.2387>>
+%<<date=2021/05/29>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6661,15 +6662,15 @@ help from Bernd Raichle, for which I am grateful.
   \def\bbl at dirparastext{\pardir\the\textdir\relax}%   %%%%
   % Sadly, we have to deal with boxes in math with basic.
   % Activated every math with the package option bidi=:
-  \def\bbl at mathboxdir{%
-    \ifcase\bbl at thetextdir\relax
-      \everyhbox{\bbl at mathboxdir@aux L}%
-    \else
-      \everyhbox{\bbl at mathboxdir@aux R}%
-     \fi}
-  \def\bbl at mathboxdir@aux#1{%
-    \@ifnextchar\egroup{}{\textdir T#1T\relax}}
   \ifnum\bbl at bidimode>\z@
+    \def\bbl at mathboxdir{%
+      \ifcase\bbl at thetextdir\relax
+        \everyhbox{\bbl at mathboxdir@aux L}%
+      \else
+        \everyhbox{\bbl at mathboxdir@aux R}%
+       \fi}
+    \def\bbl at mathboxdir@aux#1{%
+      \@ifnextchar\egroup{}{\textdir T#1T\relax}}
     \frozen at everymath\expandafter{%
       \expandafter\bbl at mathboxdir\the\frozen at everymath}
     \frozen at everydisplay\expandafter{%
@@ -6947,19 +6948,27 @@ help from Bernd Raichle, for which I am grateful.
 \let\bbl at tempb\@nnil
 \bbl at foreach\@classoptionslist{%
   \bbl at ifunset{ds@#1}%
-    {\IfFileExists{#1.ldf}{}%
-      {\IfFileExists{babel-#1.tex}{}{\@namedef{ds@#1}{}}}}%
-    {}%
-  \bbl at ifunset{ds@#1}%
-    {\def\bbl at tempb{#1}%
-     \DeclareOption{#1}{%
-       \ifnum\bbl at iniflag>\@ne
-         \bbl at ldfinit
-         \babelprovide[import]{#1}%
-         \bbl at afterldf{}%
-       \else
-         \bbl at load@language{#1}%
-       \fi}}%
+    {\IfFileExists{#1.ldf}%
+      {\def\bbl at tempb{#1}%
+       \DeclareOption{#1}{%
+         \ifnum\bbl at iniflag>\@ne
+           \bbl at ldfinit
+           \babelprovide[import]{#1}%
+           \bbl at afterldf{}%
+         \else
+           \bbl at load@language{#1}%
+         \fi}}%
+      {\IfFileExists{babel-#1.tex}% TODO. Copypaste pattern
+        {\def\bbl at tempb{#1}%
+         \DeclareOption{#1}{%
+           \ifnum\bbl at iniflag>\@ne
+             \bbl at ldfinit
+             \babelprovide[import]{#1}%
+             \bbl at afterldf{}%
+           \else
+             \bbl at load@language{#1}%
+           \fi}}%
+         {}}}%
     {}}
 %    \end{macrocode}
 %
@@ -13774,6 +13783,8 @@ help from Bernd Raichle, for which I am grateful.
     Babel.arabic.elong_map[\the\localeid]   = {}
     luatexbase.add_to_callback('post_linebreak_filter',
       Babel.arabic.justify, 'Babel.arabic.justify')
+    luatexbase.add_to_callback('hpack_filter',
+      Babel.arabic.justify_hbox, 'Babel.arabic.justify_hbox')
   }}% 
 % Save both node lists to make replacement. TODO. Save also widths to
 % make computations
@@ -13850,7 +13861,14 @@ function Babel.arabic.justify(head)
   return head
 end
 
-function Babel.arabic.justify_hlist(head, line)
+function Babel.arabic.justify_hbox(head, gc, size, pack)
+  if Babel.arabic.justify_enabled and pack == 'exactly' then
+    Babel.arabic.justify_hlist(head, nil, gc, size, pack)
+  end
+  return head
+end
+
+function Babel.arabic.justify_hlist(head, line, gc, size, pack)
   local d, new
   local k_list, k_item, pos_inline
   local width, width_new, full, k_curr, wt_pos, goal, shift
@@ -13861,6 +13879,15 @@ function Babel.arabic.justify_hlist(head, line)
   local KASHIDA = luatexbase.registernumber'bblar at kashida'
   local LOCALE = luatexbase.registernumber'bbl at attr@locale'
   
+  if line == nil then
+    line = {}
+    line.glue_sign = 1
+    line.glue_order = 0
+    line.head = head
+    line.shift = 0
+    line.width = size
+  end
+
   % Exclude last line. todo. But-- it discards one-word lines, too!
   % ? Look for glue = 12:15
   if (line.glue_sign == 1 and line.glue_order == 0) then
@@ -13868,10 +13895,6 @@ function Babel.arabic.justify_hlist(head, line)
     k_list = {}     % And all letters with kashida
     pos_inline = 0  % Not yet used
 
-    % for n in node.traverse_id(node.id'hlist', line.head) do
-    %  Babel.arabic.justify_hlist(line.head, n)
-    % end
-
     for n in node.traverse_id(GLYPH, line.head) do
       pos_inline = pos_inline + 1 % To find where it is. Not used.
 
@@ -13953,7 +13976,7 @@ function Babel.arabic.justify_hlist(head, line)
     % Must take into account marks and ins, see luatex manual.
     % Have to be executed only if there are changes. Investigate
     % what's going on exactly.
-    if subst_done then
+    if subst_done and not gc then
       d = node.hpack(line.head, full, 'exactly')
       d.shift = shift
       node.insert_before(head, line, d)
diff --git a/babel.ins b/babel.ins
index 8900bfa..d0390c5 100644
--- a/babel.ins
+++ b/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{2021/05/26}
+\def\filedate{2021/05/29}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 6cd4dc4..86da06b 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 568ad74..ae48d35 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2021/05/26 v3.59.2384]
+\ProvidesFile{bbcompat.dtx}[2021/05/29 v3.59.2387]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/ar/babel-ar.ini b/locale/ar/babel-ar.ini
index b5ac99c..4fd06a1 100644
--- a/locale/ar/babel-ar.ini
+++ b/locale/ar/babel-ar.ini
@@ -208,7 +208,8 @@ transliteration.dad.7.2 =   { string = {1|AauiIbnf|آأؤإئٮںڡ} }
 transliteration.dad.8.0 = { ([{007C}AbtjHxdrzsSDTZ`RfqklmnhUIYaui+opCvgJe]) }
 transliteration.dad.8.1 =   { string = {1|{007C}AbtjHxdrzsSDTZ`RfqklmnhUIYaui+opCvgJe|ءابتجحخدرزسصضطظعغفقكلمنهوىيَُِّْپچڤگژۀ} }
 ; 
-kashida.plain.1.0 = { ()[يئهشسقفغعضصنمكلظطخحجثتب]()[يئهشسقفغعضصنمكلظطخحجثتباأإآوؤذدزرة] }
+kashida.plain.1.0 ={
+()[يئهشسقفغعضصنمكلظطخحجثتب]()[ًٍَُِّ]*[يئهشسقفغعضصنمكلظطخحجثتباأإآوؤذدزرة] }
 kashida.plain.1.1 = { kashida = 500 }
 kashida.plain.2.0 = { ()ل()[اأإآ] }
 kashida.plain.2.1 = { kashida = 0 }





More information about the latex3-commits mailing list.