summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua')
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua26
1 files changed, 11 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua
index 345c90a2fef..02e1406e4d1 100644
--- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua
+++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua
@@ -34,22 +34,14 @@
Babel = Babel or {}
+-- eg, Babel.fontmap[1][<prefontid>]=<dirfontid>
+
Babel.fontmap = Babel.fontmap or {}
Babel.fontmap[0] = {} -- l
Babel.fontmap[1] = {} -- r
Babel.fontmap[2] = {} -- al/an
-function Babel.pre_otfload_v(head)
- -- head = Babel.numbers(head)
- head = Babel.bidi(head, true)
- return head
-end
-
-function Babel.pre_otfload_h(head, gc, sz, pt, dir)
- -- head = Babel.numbers(head)
- head = Babel.bidi(head, false, dir)
- return head
-end
+Babel.bidi_enabled = true
require('babel-bidi.lua')
@@ -169,9 +161,9 @@ function Babel.bidi(head, ispar, hdir)
end
end
d = d or 'l'
- if inmath then d = ('TRT' == tex.mathdir) and 'r' or 'l' end
- d_font = d_font or d
+ -- A short 'pause' in bidi for mapfont
+ d_font = d_font or d
d_font = (d_font == 'l' and 0) or
(d_font == 'nsm' and 0) or
(d_font == 'r' and 1) or
@@ -183,8 +175,12 @@ function Babel.bidi(head, ispar, hdir)
if new_d then
table.insert(nodes, {nil, (outer == 'l') and 'l' or 'r', nil})
- attr_d = node.get_attribute(item, ATDIR)
- attr_d = attr_d % 3
+ if inmath then
+ attr_d = 0
+ else
+ attr_d = node.get_attribute(item, ATDIR)
+ attr_d = attr_d % 3
+ end
if attr_d == 1 then
outer_first = 'r'
last = 'r'