summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/char-def.lua36
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4113 -> 4107 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/font-syn.lua59
-rw-r--r--tex/context/base/math-fen.mkiv22
-rw-r--r--tex/context/base/mult-low.lua2
-rw-r--r--tex/context/base/status-files.pdfbin24739 -> 24702 bytes
-rw-r--r--tex/context/base/status-lua.log2
-rw-r--r--tex/context/base/typo-dir.lua182
-rw-r--r--tex/context/base/x-mathml.mkiv2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
12 files changed, 210 insertions, 101 deletions
diff --git a/tex/context/base/char-def.lua b/tex/context/base/char-def.lua
index 7902ad95a..d048fa6c2 100644
--- a/tex/context/base/char-def.lua
+++ b/tex/context/base/char-def.lua
@@ -369,6 +369,7 @@ characters.data={
mathclass="open",
mathname="lparent",
mirror=0x0029,
+ textclass="open",
unicodeslot=0x0028,
},
{
@@ -381,6 +382,7 @@ characters.data={
mathclass="close",
mathname="rparent",
mirror=0x0028,
+ textclass="close",
unicodeslot=0x0029,
},
{
@@ -638,6 +640,7 @@ characters.data={
mathclass="relation",
mathname="lt",
mirror=0x003E,
+ textclass="open",
unicodeslot=0x003C,
},
{
@@ -672,6 +675,7 @@ characters.data={
mathclass="relation",
mathname="gt",
mirror=0x003C,
+ textclass="close",
unicodeslot=0x003E,
},
{
@@ -992,6 +996,7 @@ characters.data={
mathclass="open",
mathname="lbracket",
mirror=0x005D,
+ textclass="open",
unicodeslot=0x005B,
},
{
@@ -1016,6 +1021,7 @@ characters.data={
mathclass="close",
mathname="rbracket",
mirror=0x005B,
+ textclass="close",
unicodeslot=0x005D,
},
{
@@ -1349,6 +1355,7 @@ characters.data={
mathclass="open",
mathname="lbrace",
mirror=0x007D,
+ textclass="open",
unicodeslot=0x007B,
},
{
@@ -1395,6 +1402,7 @@ characters.data={
mathclass="close",
mathname="rbrace",
mirror=0x007B,
+ textclass="close",
unicodeslot=0x007D,
},
{
@@ -1764,6 +1772,7 @@ characters.data={
direction="on",
linebreak="qu",
mirror=0x00BB,
+ textclass="open",
unicodeslot=0x00AB,
},
{
@@ -1952,6 +1961,7 @@ characters.data={
direction="on",
linebreak="qu",
mirror=0x00AB,
+ textclass="close",
unicodeslot=0x00BB,
},
{
@@ -57630,6 +57640,7 @@ characters.data={
direction="on",
linebreak="qu",
mirror=0x203A,
+ textclass="open",
unicodeslot=0x2039,
},
[0x203A]={
@@ -57640,6 +57651,7 @@ characters.data={
direction="on",
linebreak="qu",
mirror=0x2039,
+ textclass="close",
unicodeslot=0x203A,
},
[0x203B]={
@@ -58139,6 +58151,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0x207E,
+ textclass="open",
specials={ "super", 0x0028 },
unicodeslot=0x207D,
},
@@ -58149,6 +58162,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0x207D,
+ textclass="close",
specials={ "super", 0x0029 },
unicodeslot=0x207E,
},
@@ -58287,6 +58301,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0x208E,
+ textclass="open",
specials={ "sub", 0x0028 },
unicodeslot=0x208D,
},
@@ -58297,6 +58312,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0x208D,
+ textclass="close",
specials={ "sub", 0x0029 },
unicodeslot=0x208E,
},
@@ -127700,6 +127716,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFE5A,
+ textclass="open",
specials={ "small", 0x0028 },
unicodeslot=0xFE59,
},
@@ -127711,6 +127728,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFE59,
+ textclass="close",
specials={ "small", 0x0029 },
unicodeslot=0xFE5A,
},
@@ -127722,6 +127740,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFE5C,
+ textclass="open",
specials={ "small", 0x007B },
unicodeslot=0xFE5B,
},
@@ -127733,6 +127752,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFE5B,
+ textclass="close",
specials={ "small", 0x007D },
unicodeslot=0xFE5C,
},
@@ -127744,6 +127764,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFE5E,
+ textclass="open",
specials={ "small", 0x3014 },
unicodeslot=0xFE5D,
},
@@ -127755,6 +127776,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFE5D,
+ textclass="close",
specials={ "small", 0x3015 },
unicodeslot=0xFE5E,
},
@@ -127815,6 +127837,7 @@ characters.data={
direction="on",
linebreak="id",
mirror=0xFE65,
+ textclass="open",
specials={ "small", 0x003C },
unicodeslot=0xFE64,
},
@@ -127826,6 +127849,7 @@ characters.data={
direction="on",
linebreak="id",
mirror=0xFE64,
+ textclass="close",
specials={ "small", 0x003E },
unicodeslot=0xFE65,
},
@@ -129185,6 +129209,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFF09,
+ textclass="open",
specials={ "wide", 0x0028 },
unicodeslot=0xFF08,
},
@@ -129196,6 +129221,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFF08,
+ textclass="close",
specials={ "wide", 0x0029 },
unicodeslot=0xFF09,
},
@@ -129387,6 +129413,7 @@ characters.data={
direction="on",
linebreak="id",
mirror=0xFF1E,
+ textclass="open",
specials={ "wide", 0x003C },
unicodeslot=0xFF1C,
},
@@ -129408,6 +129435,7 @@ characters.data={
direction="on",
linebreak="id",
mirror=0xFF1C,
+ textclass="close",
specials={ "wide", 0x003E },
unicodeslot=0xFF1E,
},
@@ -129725,6 +129753,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFF3D,
+ textclass="open",
specials={ "wide", 0x005B },
unicodeslot=0xFF3B,
},
@@ -129746,6 +129775,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFF3B,
+ textclass="close",
specials={ "wide", 0x005D },
unicodeslot=0xFF3D,
},
@@ -130073,6 +130103,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFF5D,
+ textclass="open",
specials={ "wide", 0x007B },
unicodeslot=0xFF5B,
},
@@ -130094,6 +130125,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFF5B,
+ textclass="close",
specials={ "wide", 0x007D },
unicodeslot=0xFF5D,
},
@@ -130114,6 +130146,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFF60,
+ textclass="open",
specials={ "wide", 0x2985 },
unicodeslot=0xFF5F,
},
@@ -130124,6 +130157,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFF5F,
+ textclass="close",
specials={ "wide", 0x2986 },
unicodeslot=0xFF60,
},
@@ -130145,6 +130179,7 @@ characters.data={
direction="on",
linebreak="op",
mirror=0xFF63,
+ textclass="open",
specials={ "narrow", 0x300C },
unicodeslot=0xFF62,
},
@@ -130156,6 +130191,7 @@ characters.data={
direction="on",
linebreak="cl",
mirror=0xFF62,
+ textclass="close",
specials={ "narrow", 0x300D },
unicodeslot=0xFF63,
},
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 7576a8c48..fcb1fe312 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2013.08.30 13:54}
+\newcontextversion{2013.08.30 22:40}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index b66a85c8d..d9d9041c3 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 5837a7f47..e0a6920fb 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.08.30 13:54}
+\edef\contextversion{2013.08.30 22:40}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/font-syn.lua b/tex/context/base/font-syn.lua
index 9102a57f2..77aeec553 100644
--- a/tex/context/base/font-syn.lua
+++ b/tex/context/base/font-syn.lua
@@ -57,7 +57,7 @@ names.filters = filters
names.data = names.data or allocate { }
-names.version = 1.110
+names.version = 1.120
names.basename = "names"
names.saved = false
names.loaded = false
@@ -422,15 +422,17 @@ local function check_name(data,result,filename,modification,suffix,subfont)
-- prepare
local names = check_names(result)
-- fetch
- local familyname = names and names.preffamilyname or result.familyname
- local fullname = names and names.fullname or result.fullname
- local fontname = result.fontname
- local subfamily = names and names.subfamily
- local modifiers = names and names.prefmodifiers
- local weight = names and names.weight or result.weight
- local italicangle = tonumber(result.italicangle)
- local subfont = subfont or nil
- local rawname = fullname or fontname or familyname
+ local familyname = names and names.preffamilyname or result.familyname
+ local fullname = names and names.fullname or result.fullname
+ local fontname = result.fontname
+ local subfamily = names and names.subfamily
+ local modifiers = names and names.prefmodifiers
+ local weight = names and names.weight or result.weight
+ local italicangle = tonumber(result.italicangle)
+ local subfont = subfont or nil
+ local rawname = fullname or fontname or familyname
+ local filebase = removesuffix(basename(filename))
+ local cleanfilename = cleanname(filebase) -- for WS
-- normalize
familyname = familyname and cleanname(familyname)
fullname = fullname and cleanname(fullname)
@@ -460,27 +462,28 @@ local function check_name(data,result,filename,modification,suffix,subfont)
if not familyname then
familyname = a_name
end
- fontname = fontname or fullname or familyname or basename(filename)
+ fontname = fontname or fullname or familyname or filebase -- maybe cleanfilename
fullname = fullname or fontname
familyname = familyname or fontname
specifications[#specifications + 1] = {
- filename = filename, -- unresolved
- format = lower(suffix),
- subfont = subfont,
- rawname = rawname,
- familyname = familyname,
- fullname = fullname,
- fontname = fontname,
- subfamily = subfamily,
- modifiers = modifiers,
- weight = weight,
- style = style,
- width = width,
- variant = variant,
- minsize = result.design_range_bottom or 0,
- maxsize = result.design_range_top or 0,
- designsize = result.design_size or 0,
- modification = modification or 0,
+ filename = filename, -- unresolved
+ cleanfilename = cleanfilename,
+ format = lower(suffix),
+ subfont = subfont,
+ rawname = rawname,
+ familyname = familyname,
+ fullname = fullname,
+ fontname = fontname,
+ subfamily = subfamily,
+ modifiers = modifiers,
+ weight = weight,
+ style = style,
+ width = width,
+ variant = variant,
+ minsize = result.design_range_bottom or 0,
+ maxsize = result.design_range_top or 0,
+ designsize = result.design_size or 0,
+ modification = modification or 0,
}
end
diff --git a/tex/context/base/math-fen.mkiv b/tex/context/base/math-fen.mkiv
index b487e6b5c..a7f5b2188 100644
--- a/tex/context/base/math-fen.mkiv
+++ b/tex/context/base/math-fen.mkiv
@@ -210,6 +210,7 @@
\installmathfencepair \lparent \Lparent \rparent \Rparent
\installmathfencepair \langle \Langle \rangle \Rangle
%installmathfencepair \lbar \Lbar \rbar \Rbar
+\installmathfencepair \vert \Lbar \vert \Rbar
\unexpanded\def\{{\mathortext\lbrace \letterleftbrace } % or maybe a chardef
\unexpanded\def\}{\mathortext\rbrace \letterrightbrace } % or maybe a chardef
@@ -346,12 +347,25 @@
\expandafter\math_fences_saved_right
\fi}
-\unexpanded\def\math_fences_checked_left_or_middle
+% \unexpanded\def\math_fences_checked_left_or_middle
+% {\ifcase\c_math_fenced_nesting
+% \expandafter\math_fences_saved_left
+% \else
+% \expandafter\math_fences_saved_middle
+% \fi}
+
+\newconditional\c_math_checked_done % only bars
+
+\unexpanded\def\math_fences_checked_left_or_right
{\ifcase\c_math_fenced_nesting
+ \settrue\c_math_checked_done
\expandafter\math_fences_saved_left
+ \else\ifconditional\c_math_checked_done
+ \setfalse\c_math_checked_done
+ \doubleexpandafter\math_fences_saved_right
\else
- \expandafter\math_fences_saved_middle
- \fi}
+ \doubleexpandafter\math_fences_saved_middle
+ \fi\fi}
\unexpanded\def\math_fences_checked_start
{\c_math_fenced_nesting\zerocount}
@@ -373,6 +387,8 @@
{\math_fences_checked_stop
\endgroup}
+\let\leftorright\math_fences_checked_left_or_right % for bars
+
%D The next characters were used for constructing nicer extensibles but
%D nowadays we have real characters.
diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua
index 48e262578..25cb94618 100644
--- a/tex/context/base/mult-low.lua
+++ b/tex/context/base/mult-low.lua
@@ -290,6 +290,8 @@ return {
--
"twodigits","threedigits",
--
+ "leftorright",
+ --
"strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight",
--
"ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 4c9813bb0..4d345a9b1 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.log b/tex/context/base/status-lua.log
index ee670733e..fa3648b1e 100644
--- a/tex/context/base/status-lua.log
+++ b/tex/context/base/status-lua.log
@@ -1,6 +1,6 @@
(cont-yes.mkiv
-ConTeXt ver: 2013.08.30 13:54 MKIV beta fmt: 2013.8.30 int: english/english
+ConTeXt ver: 2013.08.30 22:40 MKIV beta fmt: 2013.8.30 int: english/english
system > 'cont-new.mkiv' loaded
(cont-new.mkiv)
diff --git a/tex/context/base/typo-dir.lua b/tex/context/base/typo-dir.lua
index fcf3e3acb..16de85dd1 100644
--- a/tex/context/base/typo-dir.lua
+++ b/tex/context/base/typo-dir.lua
@@ -7,10 +7,12 @@ if not modules then modules = { } end modules ['typo-dir'] = {
}
-- todo: also use end_of_math here?
+-- todo: use lpeg instead of match
local next, type = next, type
local format, insert, sub, find, match = string.format, table.insert, string.sub, string.find, string.match
local utfchar = utf.char
+local formatters = string.formatters
-- vertical space handler
@@ -37,6 +39,9 @@ local tasks = nodes.tasks
local glyph_code = nodecodes.glyph
local whatsit_code = nodecodes.whatsit
local math_code = nodecodes.math
+local penalty_code = nodecodes.penalty
+local kern_code = nodecodes.kern
+local glue_code = nodecodes.glue
local localpar_code = whatcodes.localpar
local dir_code = whatcodes.dir
@@ -100,26 +105,28 @@ local finished, finidir, finipos = nil, nil, 1
local head, current, inserted = nil, nil, nil
local function finish_auto_before()
- head, inserted = insert_node_before(head,current,new_textdir("-"..finish))
- finished, finidir = inserted, finish
+ local fdir = "-" .. finish
+ head, inserted = insert_node_before(head,current,new_textdir(fdir))
+ finished, finidir, autodir = inserted, finish, 0
if trace_directions then
- insert(list,#list,format("auto finish inserted before: %s",finish))
- finipos = #list-1
+ insert(list,#list,formatters["auto %a inserted before, autodir %a, embedded %a"](fdir,autodir,embedded))
+ finipos = #list - 1
end
- finish, autodir, done = nil, 0, true
+ finish, done = nil, true
end
local function finish_auto_after()
- head, current = insert_node_after(head,current,new_textdir("-"..finish))
- finished, finidir = current, finish
+ local fdir = "-" .. finish
+ head, current = insert_node_after(head,current,new_textdir(fdir))
+ finished, finidir, autodir = current, finish, 0
if trace_directions then
- list[#list+1] = format("auto finish inserted after: %s",finish)
+ list[#list+1] = formatters["auto %a inserted after, autodir %a, embedded %a"](fdir,autodir,embedded)
finipos = #list
end
- finish, autodir, done = nil, 0, true
+ finish, done = nil, true
end
-local function force_auto_left_before()
+local function force_auto_left_before(d)
if finish then
finish_auto_before()
end
@@ -131,18 +138,18 @@ local function force_auto_left_before()
if finidir == finish then
head = remove_node(head,finished,true)
if trace_directions then
- list[finipos] = list[finipos] .. " (deleted afterwards)"
- insert(list,#list,format("start text dir %s (embedded: %s)",finish,embedded))
+ list[finipos] = list[finipos] .. ", deleted afterwards"
+ insert(list,#list,formatters["start text dir %a, auto left before, embedded %a, autodir %a, triggered by class %a"](finish,embedded,autodir,d))
end
else
head, inserted = insert_node_before(head,current,new_textdir("+"..finish))
if trace_directions then
- insert(list,#list,format("start text dir %s (embedded: %s)",finish,embedded))
+ insert(list,#list,formatters["start text dir %a, auto left before, embedded %a, autodir %a, triggered by class %a"](finish,embedded,autodir,d))
end
end
end
-local function force_auto_right_before()
+local function force_auto_right_before(d)
if finish then
finish_auto_before()
end
@@ -154,17 +161,49 @@ local function force_auto_right_before()
if finidir == finish then
head = remove_node(head,finished,true)
if trace_directions then
- list[finipos] = list[finipos] .. " (deleted afterwards)"
- insert(list,#list,format("start text dir %s (embedded: %s)",finish,embedded))
+ list[finipos] = list[finipos] .. ", deleted afterwards"
+ insert(list,#list,formatters["start text dir %a, auto right before, embedded %a, autodir %a, triggered by class %a"](finish,embedded,autodir,d))
end
else
head, inserted = insert_node_before(head,current,new_textdir("+"..finish))
if trace_directions then
- insert(list,#list,format("start text dir %s (embedded: %s)",finish,embedded))
+ insert(list,#list,formatters["start text dir %a, auto right before, embedded %a, autodir %a, triggered by class %a"](finish,embedded,autodir,d))
end
end
end
+local function nextisright(current)
+ repeat
+ current = current.next
+ local id = current.id
+ if id == glyph_code then
+ local char = current.char
+ local d = chardirs[char]
+ return d == "r" or d == "al" or d == "an" and current
+-- elseif id == glue_code or id == kern_code or id == penalty_code then
+-- -- too complex
+ else
+ return
+ end
+ until not current
+end
+
+local function previsright(current)
+ repeat
+ current = current.prev
+ local id = current.id
+ if id == glyph_code then
+ local char = current.char
+ local d = chardirs[char]
+ return d == "r" or d == "al" or d == "an"
+-- elseif id == glue_code or id == kern_code or id == penalty_code then
+-- -- too complex
+ else
+ return
+ end
+ until not current
+end
+
-- todo: use new dir functions
-- todo: use end_of_math
@@ -183,6 +222,7 @@ function directions.process(namespace,attribute,start) -- todo: make faster
local lro, rlo, prevattr, inmath = false, false, 0, false
while current do
local id = current.id
+-- list[#list+1] = formatters["state: node %a, finish %a, autodir %a, embedded %a"](nutstring(current),finish or "unset",autodir,embedded)
if skipmath and id == math_code then
local subtype = current.subtype
if subtype == beginmath_code then
@@ -205,17 +245,17 @@ function directions.process(namespace,attribute,start) -- todo: make faster
-- no pop, grouped driven (2=normal,3=lro,4=rlo)
if attr == 3 then
if trace_directions then
- list[#list+1] = format("override right -> left (lro) (bidi=%s)",attr)
+ list[#list+1] = formatters["override right -> left (lro), bidi %a"](attr)
end
lro, rlo = true, false
elseif attr == 4 then
if trace_directions then
- list[#list+1] = format("override left -> right (rlo) (bidi=%s)",attr)
+ list[#list+1] = formatters["override left -> right (rlo), bidi %a"](attr)
end
lro, rlo = false, true
else
if trace_directions and
- current ~= head then list[#list+1] = format("override reset (bidi=%s)",attr)
+ current ~= head then list[#list+1] = formatters["override reset, bidi %a"](attr)
end
lro, rlo = false, false
end
@@ -230,66 +270,92 @@ function directions.process(namespace,attribute,start) -- todo: make faster
if rlo or override > 0 then
if d == "l" then
if trace_directions then
- list[#list+1] = format("char %s (%s / U+%04X) of class %s overidden to r (bidi=%s)",utfchar(char),char,char,d,attr)
+ list[#list+1] = formatters["char %C of class %a overridden to r, bidi %a)"](char,d,attr)
end
d = "r"
elseif trace_directions then
if d == "lro" or d == "rlo" or d == "pdf" then -- else side effects on terminal
- list[#list+1] = format("override char of class %s (bidi=%s)",d,attr)
+ list[#list+1] = formatters["override char of class %a, bidi %a"](d,attr)
else -- todo: rle lre
- list[#list+1] = format("char %s (%s / U+%04X) of class %s (bidi=%s)",utfchar(char),char,char,d,attr)
+ list[#list+1] = formatters["char %C of class %a, bidi %a"](char,d,attr)
end
end
elseif lro or override < 0 then
if d == "r" or d == "al" then
current[a_state] = s_isol -- maybe better have a special bidi attr value -> override (9) -> todo
if trace_directions then
- list[#list+1] = format("char %s (%s / U+%04X) of class %s overidden to l (bidi=%s) (state=isol)",utfchar(char),char,char,d,attr)
+ list[#list+1] = formatters["char %C of class %a overridden to l, bidi %a, state 'isol'"](char,d,attr)
end
d = "l"
elseif trace_directions then
if d == "lro" or d == "rlo" or d == "pdf" then -- else side effects on terminal
- list[#list+1] = format("override char of class %s (bidi=%s)",d,attr)
+ list[#list+1] = formatters["override char of class %a, bidi %a"](d,attr)
else -- todo: rle lre
- list[#list+1] = format("char %s (%s / U+%04X) of class %s (bidi=%s)",utfchar(char),char,char,d,attr)
+ list[#list+1] = formatters["char %C of class %a, bidi %a"](char,d,attr)
end
end
elseif trace_directions then
if d == "lro" or d == "rlo" or d == "pdf" then -- else side effects on terminal
- list[#list+1] = format("override char of class %s (bidi=%s)",d,attr)
+ list[#list+1] = formatters["override char of class %a, bidi %a"](d,attr)
else -- todo: rle lre
- list[#list+1] = format("char %s (%s / U+%04X) of class %s (bidi=%s)",utfchar(char),char,char,d,attr)
+ list[#list+1] = formatters["char %C of class %a, bidi %a"](char,d,attr)
end
end
if d == "on" then
- local mirror = chardata[char].mirror -- maybe make a special mirror table
+ local cdata = chardata[char]
+ local mirror = cdata.mirror -- maybe make a special mirror table
if mirror and fontchar[current.font][mirror] then
-- todo: set attribute
- if autodir < 0 then
+ local class = cdata.textclass
+ if class == "open" then
+ if nextisright(current) then
+ if autodir >= 0 then
+ force_auto_right_before(d)
+ end
+ current.char = mirror
+ done = true
+ else
+ mirror = nil
+ if autodir <= 0 then
+ force_auto_left_before(d)
+ end
+ end
+ elseif class == "close" then
+ if previsright(current) then
+ current.char = mirror
+ done = true
+ else
+ mirror = nil
+ end
+ elseif autodir < 0 then
current.char = mirror
done = true
- --~ elseif left or autodir > 0 then
- --~ if not is_right(current.prev) then
- --~ current.char = mirror
- --~ done = true
- --~ end
+ else
+ mirror = nil
+ end
+ if trace_directions then
+ if mirror then
+ list[#list+1] = formatters["mirroring char %C of class %a to %C, autodir %a, bidi %a"](char,d,mirror,autodir,attr)
+ else
+ list[#list+1] = formatters["not mirroring char %C of class %a, autodir %a, bidi %a"](char,d,autodir,attr)
+ end
end
end
elseif d == "l" or d == "en" then -- european number
if autodir <= 0 then -- could be option
- force_auto_left_before()
+ force_auto_left_before(d)
end
elseif d == "r" or d == "al" then -- arabic number
if autodir >= 0 then
- force_auto_right_before()
+ force_auto_right_before(d)
end
elseif d == "an" then -- arabic number
-- actually this is language dependent ...
-- if autodir <= 0 then
--- force_auto_left_before()
+-- force_auto_left_before(d)
-- end
if autodir >= 0 then
- force_auto_right_before()
+ force_auto_right_before(d)
end
elseif d == "lro" then -- Left-to-Right Override -> right becomes left
if trace_directions then
@@ -330,11 +396,11 @@ function directions.process(namespace,attribute,start) -- todo: make faster
override, embedded = s[1], s[2]
top = top - 1
if trace_directions then
- list[#list+1] = format("state: override: %s, embedded: %s, autodir: %s",override,embedded,autodir)
+ list[#list+1] = formatters["state: override %a, embedded %a, autodir %a"](override,embedded,autodir)
end
else
if trace_directions then
- list[#list+1] = "pop (error, too many pops)"
+ list[#list+1] = "pop error: too many pops"
end
end
obsolete[#obsolete+1] = current
@@ -342,7 +408,7 @@ function directions.process(namespace,attribute,start) -- todo: make faster
elseif trace_directions then
local char = current.char
local d = chardirs[char]
- list[#list+1] = format("char %s (%s / U+%04X) of class %s (no bidi)",utfchar(char),char,char,d or "?")
+ list[#list+1] = formatters["char %C of class %a, bidi %a"](char,d or "?")
end
elseif id == whatsit_code then
if finish then
@@ -350,6 +416,7 @@ function directions.process(namespace,attribute,start) -- todo: make faster
end
local subtype = current.subtype
if subtype == localpar_code then
+-- if false then
local dir = current.dir
local d = sub(dir,2,2)
if d == 'R' then -- find(dir,".R.") / dir == "TRT"
@@ -359,13 +426,14 @@ function directions.process(namespace,attribute,start) -- todo: make faster
end
-- embedded = autodir
if trace_directions then
- list[#list+1] = format("pardir %s",dir)
+ list[#list+1] = formatters["pardir %a"](dir)
end
+-- end
elseif subtype == dir_code then
local dir = current.dir
-- local sign = sub(dir,1,1)
-- local dire = sub(dir,3,3)
- local sign, dire = match(dir,"^(.).(.)")
+ local sign, dire = match(dir,"^(.).(.)") -- splitter
if dire == "R" then
if sign == "+" then
finish, autodir = "TRT", -1
@@ -380,12 +448,12 @@ function directions.process(namespace,attribute,start) -- todo: make faster
end
end
if trace_directions then
- list[#list+1] = format("textdir %s",dir)
+ list[#list+1] = formatters["textdir %a, autodir %a"](dir,autodir)
end
end
else
if trace_directions then
- list[#list+1] = format("node %s (subtype %s)",nodecodes[id],current.subtype)
+ list[#list+1] = formatters["node %a, subtype %a"](nodecodes[id],current.subtype)
end
if finish then
finish_auto_before()
@@ -419,25 +487,9 @@ function directions.process(namespace,attribute,start) -- todo: make faster
return head, done
end
---~ local function is_right(n) -- keep !
---~ if n then
---~ local id = n.id
---~ if id == glyph_code then
---~ local attr = n[attribute]
---~ if attr and attr > 0 then
---~ local d = chardirs[n.char]
---~ if d == "r" or d == "al" then -- override
---~ return true
---~ end
---~ end
---~ end
---~ end
---~ return false
---~ end
-
---~ function directions.enable()
---~ tasks.enableaction("processors","directions.handler")
---~ end
+-- function directions.enable()
+-- tasks.enableaction("processors","directions.handler")
+-- end
local enabled = false
diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv
index 3fd58a5b3..0a0489696 100644
--- a/tex/context/base/x-mathml.mkiv
+++ b/tex/context/base/x-mathml.mkiv
@@ -122,8 +122,8 @@
\let\mmlleftdelimiter \math_fences_checked_left
\let\mmlmiddledelimiter \math_fences_checked_middle
-\let\mmlleftorrightdelimiter\math_fences_checked_left_or_middle
\let\mmlrightdelimiter \math_fences_checked_right
+\let\mmlleftorrightdelimiter\math_fences_checked_left_or_right
\def\mmlchar#1{\char#1 } % used in lua code
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 311cc9428..ef605d99c 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 08/30/13 13:54:46
+-- merge date : 08/30/13 22:40:54
do -- begin closure to overcome local limits and interference