diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-02 22:52:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-02 22:52:12 +0000 |
commit | 827d1879347a5aacecb471a576e1654149ad8a39 (patch) | |
tree | 773b8042298d8d685b88fd99261838dea531324f /Master/texmf-dist/tex/generic/babel/babel.sty | |
parent | 4de7376b42147ed2246d7320e079bdebd84d9503 (diff) |
babel (22apr19)
git-svn-id: svn://tug.org/texlive/trunk@50951 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.sty | 63 |
1 files changed, 48 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index 62fd68065fc..7ee327b7c48 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -33,7 +33,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2019/04/03 3.29 The Babel package] +\ProvidesPackage{babel}[2019/04/22 3.30 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone} @@ -187,6 +187,46 @@ \bbl@languages \fi \ifodd\bbl@engine + \def\bbl@activate@preotf{% + \let\bbl@activate@preotf\relax % only once + \directlua{ + Babel = Babel or {} + % + function Babel.pre_otfload_v(head) + if Babel.numbers and Babel.digits_mapped then + head = Babel.numbers(head) + end + if Babel.bidi_enabled then + head = Babel.bidi(head, false, dir) + end + return head + end + % + function Babel.pre_otfload_h(head, gc, sz, pt, dir) + if Babel.numbers and Babel.digits_mapped then + head = Babel.numbers(head) + end + if Babel.fixboxdirs then % Temporary! + head = Babel.fixboxdirs(head) + end + if Babel.bidi_enabled then + head = Babel.bidi(head, false, dir) + end + return head + end + % + luatexbase.add_to_callback('pre_linebreak_filter', + Babel.pre_otfload_v, + 'Babel.pre_otfload_v', + luatexbase.priority_in_callback('pre_linebreak_filter', + 'luaotfload.node_processor') or nil) + % + luatexbase.add_to_callback('hpack_filter', + Babel.pre_otfload_h, + 'Babel.pre_otfload_h', + luatexbase.priority_in_callback('hpack_filter', + 'luaotfload.node_processor') or nil) + }} \let\bbl@tempa\relax \@ifpackagewith{babel}{bidi=basic}% {\def\bbl@tempa{basic}}% @@ -200,17 +240,8 @@ \directlua{ require('babel-bidi.lua') require('babel-bidi-\bbl@tempa.lua') - luatexbase.add_to_callback('pre_linebreak_filter', - Babel.pre_otfload_v, - 'Babel.pre_otfload_v', - luatexbase.priority_in_callback('pre_linebreak_filter', - 'luaotfload.node_processor') or nil) - luatexbase.add_to_callback('hpack_filter', - Babel.pre_otfload_h, - 'Babel.pre_otfload_h', - luatexbase.priority_in_callback('hpack_filter', - 'luaotfload.node_processor') or nil) - } + } + \bbl@activate@preotf \fi \fi \bbl@trace{Defining option 'base'} @@ -276,9 +307,11 @@ \DeclareOption{bidi=basic}% {\let\bbl@beforeforeign\leavevmode \newattribute\bbl@attr@dir - % TODO - the same trick as bbl@severypar - % \everymath{\bbl@mathboxdir}% - % \everydisplay{\bbl@mathboxdir}% + % I don't like it, hackish: + \frozen@everymath\expandafter{% + \expandafter\bbl@mathboxdir\the\frozen@everymath}% + \frozen@everydisplay\expandafter{% + \expandafter\bbl@mathboxdir\the\frozen@everydisplay}% \bbl@exp{\output{\bodydir\pagedir\the\output}}% \AtEndOfPackage{\EnableBabelHook{babel-bidi}}} \else |