diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-01-26 19:34:21 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-01-26 19:34:21 +0100 |
commit | 83667a906d7cac842635bc5243db70f55b346562 (patch) | |
tree | 6d22734798c775c081c3aecb7f05faf590e6570b /tex | |
parent | b47e8c2cdeeab0bcdb1c4c32328c933f3f8599de (diff) | |
download | context-83667a906d7cac842635bc5243db70f55b346562.tar.gz |
2023-01-26 18:34:00
Diffstat (limited to 'tex')
39 files changed, 430 insertions, 261 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 0766c82c3..e224c87b5 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2023.01.24 13:47} +\newcontextversion{2023.01.26 18:32} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 3234da7b6..dd497d22f 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2023.01.24 13:47} +\edef\contextversion{2023.01.26 18:32} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index 71e6d8978..6892458b6 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -450,6 +450,7 @@ \setinterfacevariable{printable}{imprimable} \setinterfacevariable{process}{traiter} \setinterfacevariable{product}{produit} +\setinterfacevariable{profile}{profil} \setinterfacevariable{program}{programme} \setinterfacevariable{project}{projet} \setinterfacevariable{protected}{protege} diff --git a/tex/context/base/mkiv/colo-ini.lua b/tex/context/base/mkiv/colo-ini.lua index 136f5b435..7a53ca71f 100644 --- a/tex/context/base/mkiv/colo-ini.lua +++ b/tex/context/base/mkiv/colo-ini.lua @@ -662,7 +662,7 @@ local function definemixcolor(makecolor,name,fractions,cs,global,freeze) if not v then return end - values[i] = v + colorvalues[i] = v end if #values > 0 then csone = values[1][1] @@ -1366,7 +1366,14 @@ implement { end } --- playground for MS and HH +-- This is a playground for MS and HH: +-- +-- Required Contrast Ratios for WCAG Conformance (how about small text) +-- +-- Level AA Text 4.5:1 for regular text and 3.0:1 for large text (18pt or 14pt/bold) +-- Level AAA Text 7.0:1 for regular text and 4.5:1 for large text (18pt or 14pt/bold) +-- +-- Level AA Non-Text 3.0:1 for user interface components and graphics do @@ -1378,7 +1385,7 @@ do end local function luminance(color) - color = values[color] + color = colorvalues[color] if color then return (0.2126 * crap(color[2]) + 0.7152 * crap(color[3]) + 0.0722 * crap(color[4])) + 0.05 end diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 34d9b4ed0..1b0808abe 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.01.24 13:47} +\newcontextversion{2023.01.26 18:32} %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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 9e556a542..19c917ba3 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2023.01.24 13:47} +\edef\contextversion{2023.01.26 18:32} %D Kind of special: diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index ffd71ea41..088bc698c 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -66,7 +66,7 @@ return { "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", - "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", + "colonasciicode", "semicolonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index 14035ad5a..72da89718 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -538,7 +538,7 @@ return { "mathordinary", "mathoverline", "mathpenaltiesmode", - "mathpunct", + "mathpunctuation", "mathradical", "mathrelation", "mathrightclass", @@ -972,6 +972,7 @@ return { "mathcode", "mathop", "mathord", + "mathpunct", "mathrel", "mathsurround", "maxdeadcycles", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 10fca5828..2a59817c4 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 45f201541..08eb077f3 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkxl/colo-ini.mkxl b/tex/context/base/mkxl/colo-ini.mkxl index 807fdfad1..a7f483bc2 100644 --- a/tex/context/base/mkxl/colo-ini.mkxl +++ b/tex/context/base/mkxl/colo-ini.mkxl @@ -664,6 +664,31 @@ \fetchmodulecommand \showcolor \f!colo_run +%D This one shows the luminance ratio conform WCAG: +%D +%D \starttyping +%D \starttabulate[||r|] +%D \NC red \NC \colorluminance{red} \NC \NR +%D \NC green \NC \colorluminance{green} \NC \NR +%D \NC black \NC \colorluminance{black} \NC \NR +%D \NC white \NC \colorluminance{white} \NC \NR +%D \stoptabulate +%D +%D \starttabulate[||r|] +%D \NC red : green \NC \colorluminanceratio{red}{green} \NC \NR +%D \NC red : black \NC \colorluminanceratio{red}{black} \NC \NR +%D \NC red : white \NC \colorluminanceratio{red}{white} \NC \NR +%D \stoptabulate +%D +%D \usecolors[crayola] +%D +%D \compareluminance[Jade] [Onyx] \par +%D \compareluminance[Goldenrod] [Onyx] \par +%D \compareluminance[CobaltBlue][Onyx] \par +%D \stoptyping + +\fetchmodulecommand \compareluminance \f!colo_run + %D It would make sense to put the following code in \type {colo-mps}, but it it %D rather low level. diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index ac65d70cc..8d37b45f5 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.01.24 13:47} +\newcontextversion{2023.01.26 18:32} %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 ec204055b..94dc84089 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.01.24 13:47} +\immutable\edef\contextversion{2023.01.26 18:32} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/core-env.lmt b/tex/context/base/mkxl/core-env.lmt index f5b382f12..018a01767 100644 --- a/tex/context/base/mkxl/core-env.lmt +++ b/tex/context/base/mkxl/core-env.lmt @@ -18,7 +18,6 @@ local P, C, S, lpegmatch, patterns = lpeg.P, lpeg.C, lpeg.S, lpeg.match, lpeg.pa local context = context local ctxcore = context.core -local texgetcount = tex.getcount local texgetintegervalue = token.getinteger -- todo local allocate = utilities.storage.allocate @@ -119,12 +118,10 @@ setmetatablenewindex(texifs, function(t,k) end) -- kind of variable ... maybe we no longer have to cache anyway (in lmtx) setmetatableindex(texconstants, function(t,k) - -- return cache[k].command == countcode and texgetcount(k) or 0 return cache[k].command == integercode and texgetintegervalue(k) or 0 end) setmetatableindex(texconditionals, function(t,k) -- 0 == true - -- return cache[k].command == countcode and texgetcount(k) == 0 return cache[k].command == integercode and texgetintegervalue(k) == 0 end) diff --git a/tex/context/base/mkxl/font-imp-quality.lmt b/tex/context/base/mkxl/font-imp-quality.lmt index 9c57613ee..6637fa07f 100644 --- a/tex/context/base/mkxl/font-imp-quality.lmt +++ b/tex/context/base/mkxl/font-imp-quality.lmt @@ -147,7 +147,7 @@ local function initialize(tfmdata,value) factor = factor, } local data = characters and characters.data - for i, chr in next, tfmdata.characters do + for i, chr in next, tfmdata.characters do -- todo unicode local v = vector[i] if data and not v then -- we could move the data test outside (needed for plain) local d = data[i] diff --git a/tex/context/base/mkxl/layo-ini.lmt b/tex/context/base/mkxl/layo-ini.lmt index 1919558ed..2d922b16a 100644 --- a/tex/context/base/mkxl/layo-ini.lmt +++ b/tex/context/base/mkxl/layo-ini.lmt @@ -12,6 +12,9 @@ if not modules then modules = { } end modules ['layo-ini'] = { local texgetcount = tex.getcount local conditionals = tex.conditionals +local c_realpageno = tex.iscount("realpageno") +local c_pagenoshift = tex.iscount("pagenoshift") + layouts = { status = { }, } @@ -26,14 +29,14 @@ function status.leftorrightpageaction(left,right) return left, right elseif conditionals.layoutissinglesided then return left, right - elseif texgetcount("pagenoshift") % 2 == 0 then - if texgetcount("realpageno") % 2 == 0 then + elseif texgetcount(c_pagenoshift) % 2 == 0 then + if texgetcount(c_realpageno) % 2 == 0 then return right, left else return left, right end else - if texgetcount("realpageno") % 2 == 0 then + if texgetcount(c_realpageno) % 2 == 0 then return left, right else return right, left @@ -46,10 +49,10 @@ function status.isleftpage(r) return false elseif conditionals.layoutissinglesided then return false - elseif texgetcount("pagenoshift") % 2 == 0 then - return (r or texgetcount("realpageno")) % 2 == 0 + elseif texgetcount(c_pagenoshift) % 2 == 0 then + return (r or texgetcount(c_realpageno)) % 2 == 0 else - return not (r or texgetcount("realpageno")) % 2 == 0 + return not (r or texgetcount(c_realpageno)) % 2 == 0 end end diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt index 391fd0ad1..3bcfa80e2 100644 --- a/tex/context/base/mkxl/lpdf-rul.lmt +++ b/tex/context/base/mkxl/lpdf-rul.lmt @@ -189,51 +189,51 @@ do local linemapping = { [interfaces.variables.round] = "ltrb", - ["0"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb", + [ "0"] = "ltrb", ["ltrb"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb", -- ["1"] = "ltrb", ["2"] = "ltrb", ["3"] = "ltrb", ["4"] = "ltrb", ["5"] = "ltrb", ["6"] = "ltrb", ["7"] = "ltrb", ["8"] = "ltrb", -- - [ "9"] = "lbr", ["rbl"] = "lbr", - ["10"] = "tlb", ["blt"] = "tlb", - ["11"] = "ltr", ["rtl"] = "lrt", - ["12"] = "lbr", ["rbl"] = "lbr", + [ "9"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", + ["10"] = "tlb", ["tlb"] = "tlb", ["blt"] = "tlb", + ["11"] = "ltr", ["ltr"] = "ltr", ["rtl"] = "lrt", + ["12"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", -- - ["13"] = "rt", ["tr"] = "rt", - ["14"] = "rb", ["br"] = "rb", - ["15"] = "bl", ["lb"] = "bl", - ["16"] = "tl", ["lt"] = "tl", + ["13"] = "rt", ["rt"] = "rt", ["tr"] = "rt", + ["14"] = "rb", ["rb"] = "rb", ["br"] = "rb", + ["15"] = "bl", ["bl"] = "bl", ["lb"] = "bl", + ["16"] = "tl", ["tl"] = "tl", ["lt"] = "tl", -- - ["32"] = "lr", ["rl"] = "lr", - ["33"] = "tb", ["bt"] = "tb", + ["32"] = "lr", ["lr"] = "lr", ["rl"] = "lr", + ["33"] = "tb", ["tb"] = "tb", ["bt"] = "tb", -- - ["28"] = "l", - ["29"] = "r", - ["30"] = "b", - ["31"] = "t", + ["28"] = "l", ["l"] = "l", + ["29"] = "r", ["r"] = "r", + ["30"] = "b", ["b"] = "b", + ["31"] = "t", ["t"] = "t", } local roundmapping = { [interfaces.variables.round] = "ltrb", - [ "0"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb", + [ "0"] = "ltrb", ["ltrb"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb", -- - [ "9"] = "lbr", ["rbl"] = "lbr", - ["10"] = "tlb", ["blt"] = "tlb", - ["11"] = "ltr", ["rtl"] = "lrt", - ["12"] = "lbr", ["rbl"] = "lbr", + [ "9"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", + ["10"] = "tlb", ["tlb"] = "tlb", ["blt"] = "tlb", + ["11"] = "ltr", ["ltr"] = "ltr", ["rtl"] = "lrt", + ["12"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", -- - ["13"] = "rt", ["tr"] = "rt", - ["14"] = "rb", ["br"] = "rb", - ["15"] = "bl", ["lb"] = "bl", - ["16"] = "tl", ["lt"] = "tl", + ["13"] = "rt", ["rt"] = "rt", ["tr"] = "rt", + ["14"] = "rb", ["rb"] = "rb", ["br"] = "rb", + ["15"] = "bl", ["bl"] = "bl", ["lb"] = "bl", + ["16"] = "tl", ["tl"] = "tl", ["lt"] = "tl", -- - ["32"] = "lr", ["rl"] = "lr", - ["33"] = "tb", ["bt"] = "tb", + ["32"] = "lr", ["lr"] = "lr", ["rl"] = "lr", + ["33"] = "tb", ["tb"] = "tb", ["bt"] = "tb", -- - ["28"] = "l", - ["29"] = "r", - ["30"] = "b", - ["31"] = "t", + ["28"] = "l", ["l"] = "l", + ["29"] = "r", ["r"] = "r", + ["30"] = "b", ["b"] = "b", + ["31"] = "t", ["t"] = "t", } setmetatableindex(linemapping,function(t,k) @@ -329,7 +329,7 @@ do list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l", done } elseif method == "6" then -- lr list = { "q", line, "w", xmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, ymax, "l", xmin, ymax, "l", xmin, ymin, "l", done } - elseif method == "7" then -- + elseif method == "7" then -- ur list = { "q", line, "w", xxxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xmin, ymax, "l", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done } -- outlier elseif method == "8" then -- ul list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, ymin, "l", done } diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index a55331c46..1036445f1 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -993,6 +993,7 @@ do { "rule", used, 0 }, }, } + basedata.partsorientation = "vertical" basedata.parts = { { advance = used, @@ -2064,7 +2065,6 @@ do -- this could be combined with the previous local target = characters[unicode] if source and target then local sequence = data.sequence - local horizontal = data.horizontal if sequence then local parts = source.parts if parts then @@ -2095,6 +2095,9 @@ do -- this could be combined with the previous end if #p > 0 then target.parts = p + if not data.horizontal then + target.partsorientation = "vertical" + end end end end @@ -2337,6 +2340,7 @@ do { advance = mid, ["end"] = mid/2, glyph = 0x23AE, start = mid/2, extender = 1 }, { advance = top, ["end"] = top/3, glyph = 0x2320, start = top/3 }, } + integral.partsorientation = "vertical" if trace_tweaking then report_tweak("fixing the integral extensible",target,original) end @@ -2766,6 +2770,11 @@ do { 0x2021, nps("delimited right ddagger"), nps("delimited ghost ddagger") }, { 0x2217, nps("delimited right ast"), nps("delimited ghost ast") }, { 0x22C6, nps("delimited right star"), nps("delimited ghost star") }, + + { 0x231C, nps("delimited left upper corner"), nps("delimited ghost upper corner") }, + { 0x231D, nps("delimited right upper corner"), nps("delimited ghost upper corner") }, + { 0x231E, nps("delimited left lower corner"), nps("delimited ghost lower corner"), true }, + { 0x231F, nps("delimited right lower corner"), nps("delimited ghost lower corner"), true }, } function mathtweaks.addfourier(target,original,parameters) @@ -2775,45 +2784,41 @@ do local basecode = entry[1] local fouriercode = entry[2] local movecode = entry[3] + local reverse = entry[4] local basechar = characters[basecode] - local scale = parameters.scale or 1 - local variant = parameters.variant - if variant then - for i=1,variant do - local okay = basechar.next - if okay then - basecode = okay - basechar = characters[basecode] - else - break + if basechar then + local scale = parameters.scale or 1 + local variant = parameters.variant + if variant then + for i=1,variant do + local okay = basechar.next + if okay then + basecode = okay + basechar = characters[basecode] + else + break + end end end - end - local baseheight = scale * (basechar.height or 0) - local basedepth = scale * (basechar.depth or 0) - local basewidth = scale * (basechar.width or 0) - local used = baseheight/2 - local total = baseheight + basedepth - characters[movecode] = { - width = basewidth, - height = used, - unicode = basecode, - -- callback = "devirtualize", - commands = { - downcommand[used], - { "rule", used, 0 }, - }, - } - characters[fouriercode] = { - width = basewidth, - height = baseheight, - depth = basedepth, - unicode = basecode, - -- callback = "devirtualize", - commands = { - scale == 1 and charcommand[basecode] or { "slot", 0, basecode, scale, scale }, - }, - parts = { + local baseheight = scale * (basechar.height or 0) + local basedepth = scale * (basechar.depth or 0) + local basewidth = scale * (basechar.width or 0) + local used = baseheight/2 + local total = baseheight + basedepth +if reverse then + used = total / 2 -- basedepth / 2 +end + characters[movecode] = { + width = basewidth, + height = used, + unicode = basecode, + -- callback = "devirtualize", + commands = { + downcommand[used], + { "rule", used, 0 }, + }, + } + local parts = { { advance = used, ["end"] = used, @@ -2828,9 +2833,24 @@ do start = total, }, } - } - if trace_tweaking then - report_tweak("fourier %U added using %U",target,original,basecode,fouriercode) + if reverse then + parts[1], parts[2] = parts[2], parts[1] + end + characters[fouriercode] = { + width = basewidth, + height = baseheight, + depth = basedepth, + unicode = basecode, + -- callback = "devirtualize", + commands = { + scale == 1 and charcommand[basecode] or { "slot", 0, basecode, scale, scale }, + }, + partsorientation = "vertical", + parts = parts, + } + if trace_tweaking then + report_tweak("fourier %U added using %U",target,original,basecode,fouriercode) + end end end end @@ -2877,13 +2897,15 @@ do -- local used = 0.8*height local used = 1.2*height -- large overlap because no smaller pieces local total = height + depth - characters[single].parts = extensible(single,total,used) + basechar.parts = extensible(single,total,used) + basechar.partsorientation = "vertical" characters[double] = { unicode = double, width = 2*width - 1*advance, height = height, depth = depth, parts = extensible(double,total,used), + partsorientation = "vertical", callback = "devirtualize", commands = { charcommand[single], @@ -2896,7 +2918,8 @@ do width = 3*width - 2*advance, height = height, depth = depth, - vparts = extensible(triple,total,used), + parts = extensible(triple,total,used), + partsorientation = "vertical", callback = "devirtualize", commands = { charcommand[single], diff --git a/tex/context/base/mkxl/math-dld.mklx b/tex/context/base/mkxl/math-dld.mklx index 66100e0ac..dcbb17c5e 100644 --- a/tex/context/base/mkxl/math-dld.mklx +++ b/tex/context/base/mkxl/math-dld.mklx @@ -105,7 +105,7 @@ \integerdef\delimitedrightastuc \privatecharactercode{delimited right ast} \integerdef\delimitedrightstaruc \privatecharactercode{delimited right star} -% \integerdef\delimitedrighthatuc \p rivatecharactercode{delimited right hat} +% \integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat} % \integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde} % \integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check} @@ -223,4 +223,43 @@ \definemathdelimited [doublereverseprimed] [primed] [\c!right="2036] \definemathdelimited [triplereverseprimed] [primed] [\c!right="2037] +% + +\integerdef\delimitedleftuppercorner \privatecharactercode{delimited left upper corner} +\integerdef\delimitedrightuppercorner\privatecharactercode{delimited right upper corner} +\integerdef\delimitedleftlowercorner \privatecharactercode{delimited left lower corner} +\integerdef\delimitedrightlowercorner\privatecharactercode{delimited right lower corner} + +\definemathdelimited + [leftuppermarked] + [marked] + [\c!left=\delimitedleftuppercorner] + +\definemathdelimited + [rightuppermarked] + [marked] + [\c!right=\delimitedrightuppercorner] + +\definemathdelimited + [uppermarked] + [marked] + [\c!left=\delimitedleftuppercorner, + \c!right=\delimitedrightuppercorner] + +\definemathdelimited + [leftlowermarked] + [marked] + [\c!left=\delimitedleftlowercorner] + +\definemathdelimited + [rightlowermarked] + [marked] + [\c!right=\delimitedrightlowercorner] + +\definemathdelimited + [lowermarked] + [marked] + [\c!left=\delimitedleftlowercorner, + \c!right=\delimitedrightlowercorner] + \protect \endinput diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index 901d187b0..fd1cb2243 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -2609,18 +2609,18 @@ % \protected\def\math_punctuation_comma {\textcomma \futurelet\nexttoken\math_punctuation_next} % \protected\def\math_punctuation_period{\textperiod\futurelet\nexttoken\math_punctuation_next} % -% \setnewconstant\c_math_comma "002C -% \setnewconstant\c_math_period "002E +% \setnewconstant\commaasciicode "002C +% \setnewconstant\periodasciicode "002E % \setnewconstant\c_math_special"8000 % % \bgroup % -% \catcode\c_math_comma \activecatcode -% \catcode\c_math_period\activecatcode +% \catcode\commaasciicode \activecatcode +% \catcode\periodasciicode\activecatcode % % \protected\gdef\math_punctuation_initialize_indeed -% {\mathcode\c_math_comma \c_math_special -% \mathcode\c_math_period\c_math_special +% {\mathcode\commaasciicode \c_math_special +% \mathcode\periodasciicode\c_math_special % \let,\math_punctuation_comma % \let.\math_punctuation_period % \c_attr_mathpunctuation\plustwo} @@ -2660,38 +2660,49 @@ % % The next one is more efficient as it produces more flat noad lists for numbers. -\setnewconstant\c_math_comma "002C -\setnewconstant\c_math_period "002E -%setnewconstant\c_math_colon "003A -\setnewconstant\c_math_semicolon"003B -\setnewconstant\c_math_special "8000 - -% todo: use \Umathclass\c_math_comma\mathpunctcode etc for temporary switching - %D This is a dirty trick. In order to prevent a loop due to reinjection, when a %D active one is seen, the amcode is set to other. So, afterwards we need to %D reactivate. Eventually this feature will be dropped in favor of a more modern %D mechanism. -\def\math_activeate_comma {\amcode\c_math_comma \activecatcode} -\def\math_activeate_period {\amcode\c_math_period \activecatcode} -\def\math_activeate_semicolon{\amcode\c_math_semicolon\activecatcode} +%D These amcodes can be alignmenttab, superscript, subscript, letter, otherchar, or +%D active. That way we can avoid the "8000 hackery and let characters keep the +%D proper class. The code is checked when we run into an active character in math +%D mode + +\def\math_activeate_comma {\amcode\commaasciicode \activecatcode} +\def\math_activeate_period {\amcode\periodasciicode \activecatcode} +\def\math_activeate_semicolon{\amcode\semicolonasciicode\activecatcode} + +\def\math_set_o_comma {\Umathcode\commaasciicode \mathordinarycode \zerocount\commaasciicode} +\def\math_set_p_comma {\Umathcode\commaasciicode \mathpunctuationcode\zerocount\commaasciicode} +\def\math_set_o_period {\Umathcode\periodasciicode \mathordinarycode \zerocount\periodasciicode} +\def\math_set_p_period {\Umathcode\periodasciicode \mathpunctuationcode\zerocount\periodasciicode} +\def\math_set_o_semicolon{\Umathcode\semicolonasciicode\mathordinarycode \zerocount\semicolonasciicode} +\def\math_set_p_semicolon{\Umathcode\semicolonasciicode\mathpunctuationcode\zerocount\semicolonasciicode} -\def\math_set_o_comma {\Umathcode\c_math_comma \mathordinarycode \zerocount\c_math_comma} -\def\math_set_p_comma {\Umathcode\c_math_comma \mathpunctuationcode\zerocount\c_math_comma} -\def\math_set_o_period {\Umathcode\c_math_period \mathordinarycode \zerocount\c_math_period} -\def\math_set_p_period {\Umathcode\c_math_period \mathpunctuationcode\zerocount\c_math_period} -\def\math_set_o_semicolon{\Umathcode\c_math_semicolon\mathordinarycode \zerocount\c_math_semicolon} -\def\math_set_p_semicolon{\Umathcode\c_math_semicolon\mathpunctuationcode\zerocount\c_math_semicolon} +\edef\math_set_o_both{\math_set_o_period\math_set_o_comma} +\edef\math_set_p_both{\math_set_p_period\math_set_p_comma} -\edef\math_set_o_both {\math_set_o_period\math_set_o_comma} -\edef\math_set_p_both {\math_set_p_period\math_set_p_comma} +% We cannot use \mathchardef'd variants because then are intercepted as active, so: \protected\def\math_punctuation_nop_comma {\begingroup\math_set_p_comma ,\endgroup\math_activeate_comma } \protected\def\math_punctuation_nop_period {\begingroup\math_set_o_period .\endgroup\math_activeate_period } \protected\def\math_punctuation_nop_semicolon{\begingroup\math_set_p_semicolon;\endgroup\math_activeate_semicolon} -% todo: use new lookahead stuff +\def\math_punctuation_comma_next {\begingroup\Umathcode\commaasciicode \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\commaasciicode ,\endgroup\math_activeate_comma } +\def\math_punctuation_period_next {\begingroup\Umathcode\periodasciicode \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\periodasciicode .\endgroup\math_activeate_period } +\def\math_punctuation_semicolon_next{\begingroup\Umathcode\semicolonasciicode\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\semicolonasciicode;\endgroup\math_activeate_semicolon} + +% So, nicer is: +% +% \protected\def\math_punctuation_nop_comma {\Umathclass\mathpunctuationcode\commaasciicode \math_activeate_comma } +% \protected\def\math_punctuation_nop_period {\Umathclass\mathordinarycode \periodasciicode \math_activeate_period } +% \protected\def\math_punctuation_nop_semicolon{\Umathclass\mathpunctuationcode\semicolonasciicode\math_activeate_semicolon} +% +% \def\math_punctuation_comma_next {\Umathclass\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\commaasciicode \math_activeate_comma } +% \def\math_punctuation_period_next {\Umathclass\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\periodasciicode \math_activeate_period } +% \def\math_punctuation_semicolon_next{\Umathclass\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\semicolonasciicode\math_activeate_semicolon} \protected\def\math_punctuation_all_comma {\futurelet\nexttoken\math_punctuation_comma_next} \protected\def\math_punctuation_all_period {\futurelet\nexttoken\math_punctuation_period_next} @@ -2701,19 +2712,15 @@ \let\math_punctuation_yes_period \math_punctuation_nop_period \let\math_punctuation_yes_semicolon\math_punctuation_all_semicolon -\def\math_punctuation_comma_next {\begingroup\Umathcode\c_math_comma \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\c_math_comma ,\endgroup\math_activeate_comma } -\def\math_punctuation_period_next {\begingroup\Umathcode\c_math_period \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\c_math_period .\endgroup\math_activeate_period } -\def\math_punctuation_semicolon_next{\begingroup\Umathcode\c_math_semicolon\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\c_math_semicolon;\endgroup\math_activeate_semicolon} - \installcorenamespace {mathautopunctuation} \bgroup % This can and will be replaced by classes: - \catcode\c_math_comma \activecatcode - \catcode\c_math_period \activecatcode - \catcode\c_math_semicolon\activecatcode + \catcode\commaasciicode \activecatcode + \catcode\periodasciicode \activecatcode + \catcode\semicolonasciicode\activecatcode \gdefcsname\??mathautopunctuation\v!no\endcsname {\let,\math_punctuation_nop_comma @@ -2753,19 +2760,19 @@ \egroup % \appendtoks -% \global\mathcode\c_math_comma \c_math_special -% \global\mathcode\c_math_period \c_math_special -% \global\mathcode\c_math_semicolon\c_math_special +% \global\mathcode\commaasciicode \c_math_special +% \global\mathcode\periodasciicode \c_math_special +% \global\mathcode\semicolonasciicode\c_math_special % \to \everyjob -% \activatemathcharacter\c_math_comma -% \activatemathcharacter\c_math_period -% \activatemathcharacter\c_math_semicolon +% \activatemathcharacter\commaasciicode +% \activatemathcharacter\periodasciicode +% \activatemathcharacter\semicolonasciicode % \appendtoks -% \mathcode\c_math_comma \c_math_special -% \mathcode\c_math_period \c_math_special -% \mathcode\c_math_semicolon\c_math_special +% \mathcode\commaasciicode \c_math_special +% \mathcode\periodasciicode \c_math_special +% \mathcode\semicolonasciicode\c_math_special % \begincsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname % \to \everymathematics diff --git a/tex/context/base/mkxl/math-spa.lmt b/tex/context/base/mkxl/math-spa.lmt index 9840a6aef..126bb739b 100644 --- a/tex/context/base/mkxl/math-spa.lmt +++ b/tex/context/base/mkxl/math-spa.lmt @@ -46,7 +46,6 @@ local nextlist = nuts.traversers.list local nextboundary = nuts.traversers.boundary local nextnode = nuts.traversers.node -local texgetdimen = tex.getdimen local texsetdimen = tex.setdimen local texsetcount = tex.setcount local texisdimen = tex.isdimen diff --git a/tex/context/base/mkxl/pack-rul.mkxl b/tex/context/base/mkxl/pack-rul.mkxl index baaab17a5..9c25cbf05 100644 --- a/tex/context/base/mkxl/pack-rul.mkxl +++ b/tex/context/base/mkxl/pack-rul.mkxl @@ -121,6 +121,32 @@ {\installsimplecommandhandler{#1}{#2}{#3}% \installinheritedframed{#2}} +% corner options (with radius=0pt rectangular): +% +% 0 round ltrb trbl rblt bltr +% 1 2 3 4 5 6 7 8 ltrb +% 9 lbr rbl / 10 tlb blt / 11 ltr rtl / 12 lbr rbl +% 13 rt tr / 14 rb br / 15 bl lb / 16 tl lt +% 32 lr rl / 33 tb bt +% 28 l / 29 r / 30 b / 31 t + +%D \starttyping +%D \dostepwiserecurse{0}{33}{1}{ +%D \startTEXpage[offset=1dk] +%D \dontleavehmode\ruledhbox{\framed +%D [framecolor=red, +%D framecorner=#1, +%D frameradius=\zeropoint] +%D {TEST #1}} +%D \ruledhbox{\framed +%D [framecolor=red, +%D framecorner=#1, +%D frameradius=10pt] +%D {TEST #1}} +%D \stopTEXpage +%D } +%D \stoptyping + % for regular framed \setupframed diff --git a/tex/context/base/mkxl/page-blk.lmt b/tex/context/base/mkxl/page-blk.lmt index 2078245e4..4a4441fd1 100644 --- a/tex/context/base/mkxl/page-blk.lmt +++ b/tex/context/base/mkxl/page-blk.lmt @@ -10,6 +10,8 @@ local context = context local implement = interfaces.implement local texgetcount = tex.getcount +local c_realpageno = tex.iscount("realpageno") + local blocks = { } local block = false @@ -17,7 +19,7 @@ implement { name = "startpageblock", arguments = "string", actions = function(s) - local p = texgetcount("realpageno") + local p = texgetcount(c_realpageno) block = { p, p } blocks[s] = block end, @@ -26,7 +28,7 @@ implement { implement { name = "stoppageblock", actions = function() - local p = texgetcount("realpageno") - 1 + local p = texgetcount(c_realpageno) - 1 block[2] = p end, } @@ -76,7 +78,7 @@ implement { name = "startprerollpageblock", arguments = "string", actions = function(name) - currentrealpage = texgetcount("realpageno") + currentrealpage = texgetcount(c_realpageno) currentpreroll = name end } @@ -84,7 +86,7 @@ implement { implement { name = "stopprerollpageblock", actions = function() - prerolled[currentpreroll] = texgetcount("realpageno") - currentrealpage + prerolled[currentpreroll] = texgetcount(c_realpageno) - currentrealpage currentpreroll = false end } diff --git a/tex/context/base/mkxl/spac-ali.lmt b/tex/context/base/mkxl/spac-ali.lmt index 05b517d3d..9fa024672 100644 --- a/tex/context/base/mkxl/spac-ali.lmt +++ b/tex/context/base/mkxl/spac-ali.lmt @@ -117,7 +117,7 @@ function alignments.set(n) report_realign("enabled") end end - texsetattribute(a_realign,texgetcount("realpageno") * 10 + n) + texsetattribute(a_realign,texgetcount(c_realpageno) * 10 + n) end interfaces.implement { diff --git a/tex/context/base/mkxl/spac-prf.lmt b/tex/context/base/mkxl/spac-prf.lmt index 66a75cba0..d8f5169f1 100644 --- a/tex/context/base/mkxl/spac-prf.lmt +++ b/tex/context/base/mkxl/spac-prf.lmt @@ -1,4 +1,4 @@ - if not modules then modules = { } end modules ['spac-prf'] = { +if not modules then modules = { } end modules ['spac-prf'] = { version = 1.001, comment = "companion to spac-prf.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", @@ -40,6 +40,9 @@ local texlists = tex.lists local settexattribute = tex.setattribute local texgetdimen = tex.getdimen +local d_strutht = tex.isdimen("strutht") +local d_strutdp = tex.isdimen("strutdp") + local newindex = lua.newindex local nuts = nodes.nuts @@ -65,6 +68,9 @@ local getdepth = nuts.getdepth local getboxglue = nuts.getboxglue local effectiveglue = nuts.effectiveglue local findattribute = nuts.findattribute +local getspeciallist = nuts.getspeciallist + +local getlistdimensions = nuts.getlistdimensions local nextnode = nuts.traversers.node local nextglue = nuts.traversers.glue @@ -476,8 +482,8 @@ methods[v_strict] = function(top,bot,t_profile,b_profile,specification) local top = tonut(top) local bot = tonut(bot) - local strutht = specification.height or texgetdimen.strutht - local strutdp = specification.depth or texgetdimen.strutdp + local strutht = specification.height or texgetdimen(d_strutht) + local strutdp = specification.depth or texgetdimen(d_strutdp) local lineheight = strutht + strutdp local depth = getdepth(top) @@ -512,8 +518,8 @@ methods[v_fixed] = function(top,bot,t_profile,b_profile,specification) local top = tonut(top) local bot = tonut(bot) - local strutht = specification.height or texgetdimen.strutht - local strutdp = specification.depth or texgetdimen.strutdp + local strutht = specification.height or texgetdimen(d_strutht) + local strutdp = specification.depth or texgetdimen(d_strutdp) local lineheight = strutht + strutdp local depth = getdepth(top) @@ -970,15 +976,12 @@ do if subtype >= leaders_code then local leader = getleader(current) local w - w, ht, dp = getwhd(leader) -- can become getwhd(current) after 1.003 + w, ht, dp = getwhd(leader) else dp = 0 end elseif id == hlist_code then - -- maybe: offsets - -- we could do a nested check .. but then we need to push / pop glue - local shift = getshift(current) - local w, h, d = getwhd(current) + local w, h, d, shift = getlistdimensions(current) if getprop(current,"specialcontent") then -- like a margin note, maybe check for wd wd = w @@ -988,8 +991,9 @@ do dp = d + shift end elseif id == vlist_code then - local shift = getshift(current) -- todo - wd, ht, dp = getwhd(current) -- todo: use combined getter + local shift + wd, ht, dp, shift = getlistdimensions(current) + dp = dp + shift elseif id == rule_code then if subtype == strutrule_code then dp = 0 @@ -1068,15 +1072,12 @@ do if subtype >= leaders_code then local leader = getleader(current) local w - w, ht, dp = getwhd(leader) -- can become getwhd(current) after 1.003 + w, ht, dp = getwhd(leader) else ht = 0 end elseif id == hlist_code then - -- maybe: offsets - -- we could do a nested check .. but then we need to push / pop glue - local shift = getshift(current) - local w, h, d = getwhd(current) + local w, h, d, shift = getlistdimensions(current) if getprop(current,"specialcontent") then -- like a margin note, maybe check for wd wd = w @@ -1086,8 +1087,9 @@ do ht = h - shift end elseif id == vlist_code then - local shift = getshift(current) -- todo - wd, ht, dp = getwhd(current) -- todo: use combined getter + local shift + wd, ht, dp, shift = getlistdimensions(current) + ht = ht - shift elseif id == rule_code then if subtype == strutrule_code then ht = 0 @@ -1155,10 +1157,12 @@ do local defaultmethod = "a" local defaultfactor = 1 + local v_yes = interfaces.variables.yes + -- I played with different methods (like only get depths and then on the fly check with heights -- but there is no gain and it is also fuzzy. So for now we just do the whole scan. - function profilelines(list) + function profilelines(list,prev) if not list then return @@ -1170,72 +1174,75 @@ do end -- no height or depth ... skip - for current, subtype in nextglue, start do if subtype == lineskip_code and not getprop(current,"profiled") then local detail = getattr(current,a_lineprofile) if detail then - -- local amount = getwidth(current) - -- - local top, bot = getboth(current) - setprop(current,"profiled",amount) -- original amount - if top then - if getid(top) == penalty_code then - top = getprev(top) + if amount > 0 then + detail = getvalue(a_lineprofile,detail) or { } + -- + local top, bot = getboth(current) + setprop(current,"profiled",amount) -- original amount, maybe move up + if not top and prev and detail.paragraph == v_yes then + top = prev end - if top and bot then - if getid(top) == hlist_code and getsubtype(top) == linelist_code then - if getid(bot) == hlist_code and getsubtype(bot) == linelist_code then - local toplist = getlist(top) - local botlist = getlist(bot) - if toplist and botlist then - -- - local detail = getvalue(a_lineprofile,detail) or { } - local step = detail.step or defaultstep - local factor = tonumber(detail.factor) or defaultfactor - local method = detail.method or defaultmethod - local margin = step / 4 - -- - if factor > 1 then - factor = 1 - elseif factor <= 0 then - factor = 0 -- we could actually go the other way - end - -- - local natural = getdepth(top) + getheight(bot) - local added = factor * amount - local possible = natural - added - local overshoot = 0 - local topmax = ceiling(getwidth(top)/step) + 1 - local botmax = ceiling(getwidth(bot)/step) + 1 - -- if method == "a" then - local depths = getdepthprofile (top,step,margin,topmax,toplist) - local heights = getheightprofile(bot,step,margin,botmax,botlist) - local steps = min(#depths,#heights) - for i=1,steps do - local o = heights[i] + depths[i] - possible - if o > overshoot then - -- we can quit when >= added - overshoot = o --- if overshoot > added then --- break --- end - end - end - -- end - -- if overshoot < added / 2 then - -- overshoot = added / 2 - -- end - if overshoot ~= amount then -- shouldn't we round - setwidth(current,overshoot) - if show_lineprofile then - setattr(current,a_visual,glue_mode) - setattr(bot,a_visual,line_mode) - setattr(top,a_visual,line_mode) + if top then + if getid(top) == penalty_code then + top = getprev(top) + end + if top and bot then + if getid(top) == hlist_code and getsubtype(top) == linelist_code then + if getid(bot) == hlist_code and getsubtype(bot) == linelist_code then + local toplist = getlist(top) + local botlist = getlist(bot) + if toplist and botlist then + -- + local step = detail.step or defaultstep + local factor = tonumber(detail.factor) or defaultfactor + local method = detail.method or defaultmethod + local margin = step / 4 + -- + if factor > 1 then + factor = 1 + elseif factor <= 0 then + factor = 0 -- we could actually go the other way end - if show_linedetail then - report("lineskip changed from %p to %p on page %i",amount,overshoot,tex.getcount("realpageno")) + -- + local natural = getdepth(top) + getheight(bot) + local added = factor * amount + local possible = natural - added + local overshoot = 0 + local topmax = ceiling(getwidth(top)/step) + 1 + local botmax = ceiling(getwidth(bot)/step) + 1 + -- if method == "a" then + local depths = getdepthprofile (top,step,margin,topmax,toplist) + local heights = getheightprofile(bot,step,margin,botmax,botlist) + local steps = min(#depths,#heights) + for i=1,steps do + local o = heights[i] + depths[i] - possible + if o > overshoot then + -- we can quit when >= added + overshoot = o + -- if overshoot > added then + -- break + -- end + end + end + -- end + -- if overshoot < added / 2 then + -- overshoot = added / 2 + -- end + if overshoot ~= amount then -- shouldn't we round + setwidth(current,overshoot) + if show_lineprofile then + setattr(current,a_visual,glue_mode) + setattr(bot,a_visual,line_mode) + setattr(top,a_visual,line_mode) + end + if show_linedetail then + report("lineskip changed from %p to %p on page %i",amount,overshoot,tex.getcount("realpageno")) + end end end end @@ -1245,6 +1252,7 @@ do end end end + prev = nil end end @@ -1257,13 +1265,16 @@ do return head end - function profiling.pagelinehandler(head) + function profiling.pagelinehandler(head,...) if head then - profilelines(head) + local h, t = getspeciallist("pagehead") + profilelines(head,t) end return head end + -- actually we need a proper callback for this kind of things ... + function profiling.setlines(specification) if not enabled then enableaction("mvlbuilders", "builders.profiling.pagelinehandler") @@ -1282,8 +1293,23 @@ do { "method" }, { "step", "dimension" }, { "factor" }, + { "paragraph" }, } } } + interfaces.implement { + name = "lineprofilebox", + public = true, + protected = true, + actions = function(box) + local okay = nuts.getbox(box) + local list = getlist(okay) + if list then + profiling.boxlinehandler(list) + end + end, + arguments = "integer" + } + end diff --git a/tex/context/base/mkxl/spac-prf.mklx b/tex/context/base/mkxl/spac-prf.mklx index fc3e4ae22..de5defc3e 100644 --- a/tex/context/base/mkxl/spac-prf.mklx +++ b/tex/context/base/mkxl/spac-prf.mklx @@ -61,13 +61,13 @@ \def\spac_profile_set {\clf_setprofile - name {\currentprofile}% - height \dimexpr\profileparameter\c!height\relax - depth \dimexpr\profileparameter\c!depth\relax - distance \dimexpr\profileparameter\c!distance\relax - factor \numexpr\profileparameter\c!factor\relax - lines \numexpr\profileparameter\c!lines\relax - method {\profileparameter\c!method}% + name {\currentprofile}% + height \dimexpr\profileparameter\c!height\relax + depth \dimexpr\profileparameter\c!depth\relax + distance \dimexpr\profileparameter\c!distance\relax + factor \numexpr\profileparameter\c!factor\relax + lines \numexpr\profileparameter\c!lines\relax + method {\profileparameter\c!method}% \relax} \tolerant\protected\def\spac_profile_start#profile#spacer[#settings]% @@ -157,14 +157,16 @@ \setuplineprofile [\c!method=\v!a, \c!step=.5\emwidth, % maybe 2pt + \c!paragraph=\v!no, \c!factor=.125] % maybe 0.250 \def\spac_line_profile_set {\clf_setlineprofile - name {\currentlineprofile}% - step \dimexpr\lineprofileparameter\c!step\relax - factor {\lineprofileparameter\c!factor} - method {\lineprofileparameter\c!method}% + name {\currentlineprofile}% + step \dimexpr\lineprofileparameter\c!step\relax + factor {\lineprofileparameter\c!factor}% + method {\lineprofileparameter\c!method}% + paragraph {\lineprofileparameter\c!paragraph}% \relax} \permanent\tolerant\protected\def\setlineprofile[#profile]% diff --git a/tex/context/base/mkxl/spac-ver.lmt b/tex/context/base/mkxl/spac-ver.lmt index a0b1d5a94..06032bcce 100644 --- a/tex/context/base/mkxl/spac-ver.lmt +++ b/tex/context/base/mkxl/spac-ver.lmt @@ -56,8 +56,6 @@ local texsetcount = tex.setcount local texnest = tex.nest local texgetbox = tex.getbox -local tg = texgetdimen - local buildpage = tex.triggerbuildpage local variables = interfaces.variables @@ -116,9 +114,10 @@ local d_globalbodyfontstrutheight = tex.isdimen("globalbodyfontstrutheight") local d_globalbodyfontstrutdepth = tex.isdimen("globalbodyfontstrutdepth") ----- d_strutht = tex.isdimen("strutht") local d_strutdp = tex.isdimen("strutdp") - local d_spac_overlay = tex.isdimen("d_spac_overlay") +local c_spac_vspacing_ignore_parskip = tex.iscount("c_spac_vspacing_ignore_parskip") + local nuts = nodes.nuts local tonut = nuts.tonut @@ -2248,14 +2247,13 @@ do end elseif subtype == parskip_code then -- if where == new_graf then ... end - if texgetcount("c_spac_vspacing_ignore_parskip") > 0 then - -- texsetcount("c_spac_vspacing_ignore_parskip",0) + if texgetcount(c_spac_vspacing_ignore_parskip) > 0 then setglue(n) -- maybe removenode end end end - texsetcount("c_spac_vspacing_ignore_parskip",0) + texsetcount(c_spac_vspacing_ignore_parskip,0) if forceflush then forceflush = false diff --git a/tex/context/base/mkxl/spac-ver.mkxl b/tex/context/base/mkxl/spac-ver.mkxl index 76dc97dc5..807ecfcd3 100644 --- a/tex/context/base/mkxl/spac-ver.mkxl +++ b/tex/context/base/mkxl/spac-ver.mkxl @@ -25,6 +25,7 @@ \newgluespec \s_spac_vspacing_predefined \newdimension\d_spac_overlay +\newinteger \c_spac_vspacing_ignore_parskip % \overloaded\let\strutht \undefined \newdimen\strutht % already defined % \overloaded\let\strutdp \undefined \newdimen\strutdp @@ -2359,8 +2360,6 @@ \fi \endgroup} -\newinteger\c_spac_vspacing_ignore_parskip - % \setupwhitespace[line] % \setuphead[subject][after={\blank[packed]},style=\bfb] % \subject{foo} diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl index e3dd91af5..2b37e30c6 100644 --- a/tex/context/base/mkxl/syst-ini.mkxl +++ b/tex/context/base/mkxl/syst-ini.mkxl @@ -142,6 +142,7 @@ \immutable\integerdef\periodasciicode 46 \immutable\integerdef\forwardslashasciicode 47 % / \immutable\integerdef\colonasciicode 58 +\immutable\integerdef\semicolonasciicode 59 \immutable\integerdef\lessthanasciicode 60 % < used as alternative verbatim { \immutable\integerdef\morethanasciicode 62 % > used as alternative verbatim } \immutable\integerdef\questionmarkasciicode 63 % ? used in namespace protection @@ -1490,4 +1491,8 @@ % \setdefaultmathcodes % initializes traditional codes +%D Catch + +\ifdefined\mathpunctuation \else \let\mathpunctuation\mathpunct \fi % fixed in 2.10.06 + \protect \endinput diff --git a/tex/context/base/mkxl/tabl-xtb.lmt b/tex/context/base/mkxl/tabl-xtb.lmt index 2a3b9a3b0..b69bfd873 100644 --- a/tex/context/base/mkxl/tabl-xtb.lmt +++ b/tex/context/base/mkxl/tabl-xtb.lmt @@ -120,6 +120,7 @@ local d_tabl_x_distance = texisdimen("d_tabl_x_distance") local d_tabl_x_width = texisdimen("d_tabl_x_width") local d_tabl_x_height = texisdimen("d_tabl_x_height") local d_tabl_x_depth = texisdimen("d_tabl_x_depth") +local d_lineheight = texisdimen("lineheight") local c_frameddimensionstate = texiscount("frameddimensionstate") @@ -227,7 +228,7 @@ function xtables.create(settings) settings.rightmargindistance = tonumber(settings.rightmargindistance) or 0 settings.options = globaloptions settings.textwidth = tonumber(settings.textwidth) or texget("hsize") - settings.lineheight = tonumber(settings.lineheight) or texgetdimen("lineheight") + settings.lineheight = tonumber(settings.lineheight) or texgetdimen(d_lineheight) settings.maxwidth = tonumber(settings.maxwidth) or settings.textwidth/8 -- if #stack > 0 then -- settings.textwidth = texget("hsize") @@ -335,7 +336,7 @@ function xtables.set_reflow_width() drc.ht = height drc.dp = depth -- - local dimensionstate = texgetcount("frameddimensionstate") + local dimensionstate = texgetcount(c_frameddimensionstate) local fixedcolumns = data.fixedcolumns local fixedrows = data.fixedrows if dimensionstate == 1 then diff --git a/tex/context/base/mkxl/task-ini.lmt b/tex/context/base/mkxl/task-ini.lmt index 0e96c1e8e..85892c7f5 100644 --- a/tex/context/base/mkxl/task-ini.lmt +++ b/tex/context/base/mkxl/task-ini.lmt @@ -98,6 +98,7 @@ appendaction("shipouts", "wrapup", "nodes.handlers.export", appendaction("shipouts", "wrapup", "luatex.synctex.collect", nil, "nut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.showtree", nil, "nonut", "disabled" ) +appendaction("math", "normalizers", "noads.handlers.collapse", nil, "nonut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.numbers", nil, "nonut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.spacing", nil, "nonut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.fencing", nil, "nonut", "disabled" ) @@ -107,7 +108,7 @@ appendaction("math", "normalizers", "noads.handlers.relocate", appendaction("math", "normalizers", "noads.handlers.variants", nil, "nonut", "enabled" ) appendaction("math", "normalizers", "noads.handlers.families", nil, "nonut", "enabled" ) appendaction("math", "normalizers", "noads.handlers.render", nil, "nonut", "enabled" ) -appendaction("math", "normalizers", "noads.handlers.collapse", nil, "nonut", "disabled" ) +------------("math", "normalizers", "noads.handlers.collapse", nil, "nonut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.fixscripts", nil, "nonut", "enabled" ) ------------("math", "normalizers", "noads.handlers.domains", nil, "nonut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.autofences", nil, "nonut", "disabled" ) diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt index 68310ef69..dddb4799d 100644 --- a/tex/context/base/mkxl/trac-vis.lmt +++ b/tex/context/base/mkxl/trac-vis.lmt @@ -545,7 +545,7 @@ local fontkern, italickern, marginkern, mathkern do setshift(text,-5 * exheight) info = new_hlist(setlink(rule,text)) setattr(info,a_layer,layer) - f_cache[kern] = info + cache[kern] = info end head = insertnodebefore(head,current,copylist(info)) return head, current @@ -583,7 +583,7 @@ local ruledglyphexpansion do extra = extra / 1000 local info = f_cache[extra] if not info then - local text = hpack_string(round(extra),usedfont) + local text = hpack_string(tostring(round(extra)),usedfont) local rule = new_rule(emwidth/fraction,exheight,2*exheight) local list = getlist(text) if extra > 0 then @@ -594,13 +594,12 @@ local ruledglyphexpansion do setlisttransparency(list,"trace:ds") setcolor(rule,"trace:ds") settransparency(rule,"trace:ds") - setshift(text,1.5 * exheight) + setshift(text,1.75 * exheight) info = new_hlist(setlink(rule,text)) setattr(info,a_layer,l_expansion) f_cache[extra] = info end head = insertnodebefore(head,current,copylist(info)) - return head, current end return head, current end @@ -619,7 +618,7 @@ local kernexpansion do extra = extra / 1000 local info = f_cache[extra] if not info then - local text = hpack_string(round(extra),usedfont) + local text = hpack_string(tostring(round(extra)),usedfont) local rule = new_rule(emwidth/fraction,exheight,4*exheight) local list = getlist(text) if extra > 0 then @@ -636,7 +635,6 @@ local kernexpansion do f_cache[extra] = info end head = insertnodebefore(head,current,copylist(info)) - return head, current end return head, current end diff --git a/tex/context/base/mkxl/typo-cap.lmt b/tex/context/base/mkxl/typo-cap.lmt index 5d7dfdedb..c0e197576 100644 --- a/tex/context/base/mkxl/typo-cap.lmt +++ b/tex/context/base/mkxl/typo-cap.lmt @@ -66,8 +66,6 @@ local variables = interfaces.variables local v_reset = variables.reset local texsetattribute = tex.setattribute ------ unsetvalue = attributes.unsetvalue ------ texgetcount = tex.getcount local texgetscales = tex.getglyphscales typesetters = typesetters or { } @@ -406,7 +404,7 @@ function cases.set(n,id) return end end - texsetattribute(a_cases) -- ,unsetvalue) + texsetattribute(a_cases) end -- interface diff --git a/tex/context/base/mkxl/typo-lin.lmt b/tex/context/base/mkxl/typo-lin.lmt index 0824a8079..42ee5a957 100644 --- a/tex/context/base/mkxl/typo-lin.lmt +++ b/tex/context/base/mkxl/typo-lin.lmt @@ -99,7 +99,6 @@ local new_glue = nodepool.glue local righttoleft_code = nodes.dirvalues.righttoleft -local texgetcount = tex.getcount local setmetatableindex = table.setmetatableindex local jobpositions = job.positions diff --git a/tex/context/base/mkxl/typo-mar.lmt b/tex/context/base/mkxl/typo-mar.lmt index 87eafb062..cf0ef39b2 100644 --- a/tex/context/base/mkxl/typo-mar.lmt +++ b/tex/context/base/mkxl/typo-mar.lmt @@ -284,11 +284,11 @@ function margins.save(t) -- t.leftmargindistance = leftmargindistance -- todo:layoutstatus table t.rightmargindistance = rightmargindistance - t.leftedgedistance = texgetdimen("naturalleftedgedistance") - + texgetdimen("leftmarginwidth") + t.leftedgedistance = texgetdimen("naturalleftedgedistance") -- can be swapped + + texgetdimen("leftmarginwidth") -- can be swapped + leftmargindistance - t.rightedgedistance = texgetdimen("naturalrightedgedistance") - + texgetdimen("rightmarginwidth") + t.rightedgedistance = texgetdimen("naturalrightedgedistance") -- can be swapped + + texgetdimen("rightmarginwidth") -- can be swapped + rightmargindistance t.lineheight = texgetdimen("lineheight") -- diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index c9021352b..30a49da80 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -111,6 +111,7 @@ return { -- [0x1D465] = { bottomright = -0.05, }, -- italic x (ic is too large) [0x00393] = { bottomright = -0.30, }, -- upright Gamma + [0x1D43F] = { bottomright = 0.01, }, -- upright L ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml index 3dc8bf282..e9794ab0b 100644 --- a/tex/context/interface/mkii/keys-fr.xml +++ b/tex/context/interface/mkii/keys-fr.xml @@ -453,6 +453,7 @@ <cd:variable name='printable' value='imprimable'/> <cd:variable name='process' value='traiter'/> <cd:variable name='product' value='produit'/> + <cd:variable name='profile' value='profil'/> <cd:variable name='program' value='programme'/> <cd:variable name='project' value='projet'/> <cd:variable name='protected' value='protege'/> diff --git a/tex/context/modules/mkxl/s-colors-show.mkxl b/tex/context/modules/mkxl/s-colors-show.mkxl index 3f1692f98..3658e632c 100644 --- a/tex/context/modules/mkxl/s-colors-show.mkxl +++ b/tex/context/modules/mkxl/s-colors-show.mkxl @@ -237,6 +237,16 @@ \hss}}} \endgraf} +\permanent\tolerant\protected\def\compareluminance[#1]#*[#2]% by MS + {\dontleavehmode\hpack\bgroup + \unframed + [\c!background=\v!color,\c!backgroundcolor=#2,\c!foregroundcolor=#1,\c!loffset=.25\exheight,\c!roffset=.25\exheight]% + {#1\enspace#2\quad\colorluminanceratio{#1}{#2}}% + \unframed + [\c!background=\v!color,\c!backgroundcolor=#1,\c!foregroundcolor=#2,\c!loffset=.25\exheight,\c!roffset=.25\exheight]% + {#2\enspace#1\quad\colorluminanceratio{#2}{#1}}% + \egroup} + \protect \continueifinputfile{s-colors-show.mkxl} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 045081e2b..567851faf 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2023-01-24 13:47 +-- merge date : 2023-01-26 18:32 do -- begin closure to overcome local limits and interference |