diff options
Diffstat (limited to 'tex/context/base/mkxl')
-rw-r--r-- | tex/context/base/mkxl/cont-new.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-act.lmt | 92 | ||||
-rw-r--r-- | tex/context/base/mkxl/tabl-com.mkxl | 7 |
4 files changed, 83 insertions, 20 deletions
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 9f4678349..cc8a43777 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.04.11 22:45} +\newcontextversion{2023.04.15 00:19} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index 19cc4ee85..d866f4b94 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2023.04.11 22:45} +\immutable\edef\contextversion{2023.04.15 00:19} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index e8310ef2b..f6fd5dab5 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -1309,6 +1309,7 @@ do else c.width = width end +c.bottomanchor = width/2 -- maybe optional end if italic then c.italic = nil @@ -1349,8 +1350,9 @@ do end end end - return - elseif not list or list == "all" or list == true or parameters.all then + goto done + end + if not list or list == "all" or list == true or parameters.all then list = sortedkeys(targetcharacters) elseif type(list) == "string" then list = { list } @@ -1377,6 +1379,7 @@ do end end end + ::done:: feedback_tweak(whatever,target,original,done) end @@ -1958,7 +1961,7 @@ do newprivateslot("minus rule right piece"), } - local function useminus(target,unicode,characters,parameters,skipfirst,what) + local function useminus(target,unicode,characters,parameters,skipfirst,what,tounicode) local minus = characters[0x2212] local parts = minus.parts if parameters == true then @@ -1996,7 +1999,7 @@ do leftcommand[xshift], downcommand[yshift], -- slotcommand[0][glyph], - { "slot", 0, glyph, xscale, yscale }, + { "slot", 0, glyph, xscale, yscale }, }, } part.glyph = what[i] @@ -2011,7 +2014,7 @@ do -- slotcommand[0][0x2212], { "slot", 0, 0x2212, xscale, yscale }, }, - unicode = unicode, + unicode = tounicode or unicode, parts = parts, partsorientation = "horizontal", } @@ -2020,7 +2023,7 @@ do -- add minus parts of not there and create clipped clone - local function checkminus(target,unicode,characters,parameters,skipfirst,what) + local function checkminus(target,unicode,characters,parameters,skipfirst,what,tounicode) local minus = characters[unicode] local parts = minus.parts if parameters == true then @@ -2092,6 +2095,7 @@ do } minus.partsorientation = "horizontal" end + minus.unicode = tounicode or unicode end function mathtweaks.replacerules(target,original,parameters) @@ -2104,10 +2108,10 @@ do checkminus(target,0x2212,characters,minus,false,mrp) end if fraction then - useminus(target,fbe,characters,fraction,false,frp) + useminus(target,fbe,characters,fraction,false,frp,0x2044) -- division slash end if radical then - useminus(target,rbe,characters,radical,true,rrp) + useminus(target,rbe,characters,radical,true,rrp,0x2061) -- apply function end if stacker then useminus(target,0x203E,characters,stacker,false,frp) @@ -2666,6 +2670,7 @@ do -- see pagella for an extensive example [0x030A] = { 0x02DA, false }, [0x0303] = { 0x02DC, true }, [0x20DB] = { 0x20DB, false }, +-- [0x20EF] = { 0x20EF, false }, } datasets.fixaccents = mapping @@ -2673,6 +2678,18 @@ do -- see pagella for an extensive example datasets.flattenaccents = mapping datasets.copyaccents = mapping + -- local flat = stretchingdata.flataccent + -- if flat then + -- -- Nasty! xoffset needed. Check this when we patch vf. + -- local flatdata = characters[flat] + -- flatdata.width = width + -- flatdata.advance = 0 + -- flatdata.topanchor = topanchor + -- flatdata.xoffset = width + topanchor + -- end + +local cdata = characters.data + function mathtweaks.fixaccents(target,original,parameters) local characters = target.characters local done = false @@ -2680,22 +2697,27 @@ do -- see pagella for an extensive example local alias = entry[1] local stretchingdata = characters[stretching] if stretchingdata and stretchingdata.width == 0 then +if false then + local b = target.descriptions[stretching].boundingbox + if b then + local llx = b[1] * target.parameters.hfactor + local urx = b[3] * target.parameters.hfactor + width = urx - llx + stretchingdata.width = width + stretchingdata.xoffset = - llx + stretchingdata.advance = urx + stretchingdata.topanchor = width/2 + stretchingdata.bottomanchor = width/2 + end +else local topanchor = stretchingdata.topanchor or 0 local width = -topanchor - topanchor = width/2 + topanchor = width/2 stretchingdata.width = width stretchingdata.advance = 0 stretchingdata.topanchor = topanchor stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] } --- local flat = stretchingdata.flataccent --- if flat then --- -- Nasty! xoffset needed. Check this when we patch vf. --- local flatdata = characters[flat] --- flatdata.width = width --- flatdata.advance = 0 --- flatdata.topanchor = topanchor --- flatdata.xoffset = width + topanchor --- end +end if not trace_tweaking then done = true elseif done then @@ -2708,6 +2730,40 @@ do -- see pagella for an extensive example feedback_tweak("fixaccents",target,original,done) end + function mathtweaks.checkaccents(target,original,parameters) + local characters = target.characters + local done = false + local factor = target.parameters.hfactor + for unicode, data in sortedhash(characters) do + local width = data.width + if width == 0 then + local d = chardata[data.unicode or unicode] + local c = d and d.category + if c == "mn" then + local b = target.descriptions[unicode].boundingbox + if b then + local llx = b[1] * factor + local urx = b[3] * factor + width = urx - llx + data.width = width + data.xoffset = - llx + data.advance = urx + data.topanchor = width/2 + data.bottomanchor = width/2 + end + if not trace_tweaking then + done = true + elseif done then + done[unicode] = true + else + done = { [unicode] = true } + end + end + end + end + feedback_tweak("checkaccents",target,original,done) + end + -- all true|number false function mathtweaks.extendaccents(target,original,parameters) diff --git a/tex/context/base/mkxl/tabl-com.mkxl b/tex/context/base/mkxl/tabl-com.mkxl index d8eb7ada7..8621d2f62 100644 --- a/tex/context/base/mkxl/tabl-com.mkxl +++ b/tex/context/base/mkxl/tabl-com.mkxl @@ -49,6 +49,7 @@ \permanent\protected\lettonothing\BH \permanent\protected\lettonothing\BL \permanent\protected\lettonothing\BR +\permanent\protected\lettonothing\BT \permanent\protected\lettonothing\CC \permanent\protected\lettonothing\CL \permanent\protected\lettonothing\CM @@ -68,6 +69,8 @@ \permanent\protected\lettonothing\HL \permanent\protected\lettonothing\HQ \permanent\protected\lettonothing\HR +\permanent\protected\lettonothing\HF +\permanent\protected\lettonothing\HLHL \permanent\protected\lettonothing\LB \permanent\protected\lettonothing\LC \permanent\protected\lettonothing\LT @@ -94,9 +97,13 @@ \permanent\protected\lettonothing\SM \permanent\protected\lettonothing\SR \permanent\protected\lettonothing\TB +\permanent\protected\lettonothing\TC \permanent\protected\lettonothing\TL +\permanent\protected\lettonothing\TM \permanent\protected\lettonothing\TR +\permanent\protected\lettonothing\TT \permanent\protected\lettonothing\VL +\permanent\protected\lettonothing\VLVL \permanent\protected\lettonothing\VC \permanent\protected\lettonothing\VD \permanent\protected\lettonothing\VN |