diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/math-act.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/math-act.lua | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-act.lua b/Master/texmf-dist/tex/context/base/mkiv/math-act.lua index 07ef32746a4..77a355b225f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/math-act.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/math-act.lua @@ -23,12 +23,6 @@ local mathematics = mathematics local texsetdimen = tex.setdimen local abs = math.abs -local helpers = fonts.helpers -local upcommand = helpers.commands.up -local rightcommand = helpers.commands.right -local charcommand = helpers.commands.char -local prependcommands = helpers.prependcommands - local sequencers = utilities.sequencers local appendgroup = sequencers.appendgroup local appendaction = sequencers.appendaction @@ -243,6 +237,7 @@ function mathematics.overloaddimensions(target,original,set) local factor = parameters.factor local hfactor = parameters.hfactor local vfactor = parameters.vfactor + local addprivate = fonts.helpers.addprivate -- to be sure target.type = "virtual" target.properties.virtualized = true @@ -262,8 +257,7 @@ function mathematics.overloaddimensions(target,original,set) local height = data.height local depth = data.depth if trace_defining and (width or height or depth) then - report_math("overloading dimensions of %C, width %p, height %p, depth %p", - unicode,width or 0,height or 0,depth or 0) + report_math("overloading dimensions of %C, width %a, height %a, depth %a",unicode,width,height,depth) end if width then character.width = width * hfactor end if height then character.height = height * vfactor end @@ -276,26 +270,25 @@ function mathematics.overloaddimensions(target,original,set) if d then xoffset = - d.boundingbox[1] * hfactor character.width = character.width + xoffset - xoffset = rightcommand[xoffset] - else - xoffset = nil + xoffset = { "right", xoffset } end - elseif xoffset and xoffset ~= 0 then - xoffset = rightcommand[xoffset * hfactor] - else - xoffset = nil + elseif xoffset then + xoffset = { "right", xoffset * hfactor } end - if yoffset and yoffset ~= 0 then - yoffset = upcommand[yoffset * vfactor] - else - yoffset = nil + if yoffset then + yoffset = { "down", -yoffset * vfactor } end if xoffset or yoffset then - local commands = characters.commands - if commands then - prependcommands(commands,yoffset,xoffset) + if character.commands then + if yoffset then + insert(character.commands,1,yoffset) + end + if xoffset then + insert(character.commands,1,xoffset) + end else - local slot = charcommand[unicode] + -- local slot = { "slot", 1, addprivate(target,nil,fastcopy(character)) } + local slot = { "slot", 0, addprivate(target,nil,fastcopy(character)) } if xoffset and yoffset then character.commands = { xoffset, yoffset, slot } elseif xoffset then @@ -304,6 +297,7 @@ function mathematics.overloaddimensions(target,original,set) character.commands = { yoffset, slot } end end + character.index = nil end elseif trace_defining then report_math("no overloading dimensions of %C, not in font",unicode) @@ -738,9 +732,9 @@ function mathematics.finishfallbacks(target,specification,fallbacks) done[unic] = true end end - local step = offset - start for unicode = start, stop do - remap(unicode + step,unicode,false) + local unic = unicode + offset - start + remap(unic,unicode,false) end if gaps then for unic, unicode in next, gaps do |