diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/luababel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/luababel.def | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 62687deafa9..ca9aef3ac7e 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -12,6 +12,7 @@ %% any individual authors listed elsewhere in this file. %% All rights reserved. %% +%% %% This file is part of the Babel system. %% -------------------------------------- %% @@ -26,7 +27,6 @@ %% 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 @@ -558,6 +558,8 @@ 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') }}% \def\bblar@fetchjalt#1#2#3#4{% \bbl@exp{\\\bbl@foreach{#1}}{% @@ -629,8 +631,14 @@ function Babel.arabic.justify(head) end function Babel.arabic.justify_hbox(head, gc, size, pack) + local has_inf = false if Babel.arabic.justify_enabled and pack == 'exactly' then - Babel.arabic.justify_hlist(head, nil, gc, size, pack) + for n in node.traverse_id(12, head) do + if n.stretch_order > 0 then has_inf = true end + end + if not has_inf then + Babel.arabic.justify_hlist(head, nil, gc, size, pack) + end end return head end |