diff options
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r-- | tex/context/base/mkiv/char-def.lua | 225 | ||||
-rw-r--r-- | tex/context/base/mkiv/char-ini.lua | 1 | ||||
-rw-r--r-- | tex/context/base/mkiv/cldf-ver.lua | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/data-tex.lua | 5 | ||||
-rw-r--r-- | tex/context/base/mkiv/font-cff.lua | 122 | ||||
-rw-r--r-- | tex/context/base/mkiv/meta-imp-mat.mkiv | 16 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-low.lua | 5 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-prm.lua | 9 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-prm.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 24626 -> 24620 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 259165 -> 259919 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/util-rnd.lua | 116 |
14 files changed, 403 insertions, 106 deletions
diff --git a/tex/context/base/mkiv/char-def.lua b/tex/context/base/mkiv/char-def.lua index 6449e085e..5325dc06e 100644 --- a/tex/context/base/mkiv/char-def.lua +++ b/tex/context/base/mkiv/char-def.lua @@ -456,7 +456,7 @@ characters.data={ direction="es", linebreak="pr", mathclass="binary", - mathgroup="nary arithmic", + mathgroup="nary arithmetic", unicodeslot=0x2B, }, { @@ -480,7 +480,7 @@ characters.data={ direction="es", linebreak="hy", mathclass="ordinary", - mathgroup="binary arithmic", + mathgroup="binary arithmetic", mathextensible="h", mathfiller="relfill", mathname="mathhyphen", @@ -497,8 +497,16 @@ characters.data={ description="FULL STOP", direction="cs", linebreak="is", - mathclass="punctuation", - mathname="ldotp", + mathspec={ + { + class="binary", + name="ldot", + }, + { + class="punctuation", + name="ldotp", + }, + }, synonyms={ "decimal point", "dot", "period" }, unicodeslot=0x2E, }, @@ -511,6 +519,16 @@ characters.data={ direction="cs", linebreak="sy", mathclass="division", + mathspec={ + { + class="division", + name="slash", + }, + { + class="division", + name="solidus", + }, + }, synonyms={ "slash", "virgule" }, unicodeslot=0x2F, }, @@ -683,6 +701,7 @@ characters.data={ { class="relation", name="Relbar", + comment="useless", }, }, unicodeslot=0x3D, @@ -1028,13 +1047,14 @@ characters.data={ { adobename="asciicircum", category="sk", + comment="the Hat looks rediculous in most fonts", cjkwd="na", contextname="textasciicircum", description="CIRCUMFLEX ACCENT", direction="on", linebreak="al", - mathclass="topaccent", - mathname="Hat", +--mathclass="topaccent", +--mathname="Hat", synonyms={ "spacing circumflex accent" }, unicodeslot=0x5E, }, @@ -1057,8 +1077,17 @@ characters.data={ description="GRAVE ACCENT", direction="on", linebreak="al", - mathclass="topaccent", - mathname="grave", + mathspec={ + { + class="topaccent", + name="grave", + }, + { + class="topaccent", + name="widegrave", + stretch="h", + }, + }, synonyms={ "spacing grave accent" }, unicodeslot=0x60, }, @@ -1347,11 +1376,12 @@ characters.data={ description="VERTICAL LINE", direction="on", linebreak="ba", + mathclass="ordinary", mathspec={ - { - class="ordinary", - name="arrowvert", - }, +-- { +-- class="ordinary", +-- name="arrowvert", +-- }, { class="delimiter", name="vert", @@ -1365,10 +1395,6 @@ characters.data={ name="rvert", }, { - class="relation", - name="mid", - }, - { class="delimiter", name="singleverticalbar", }, @@ -1733,8 +1759,17 @@ characters.data={ description="DIAERESIS", direction="on", linebreak="ai", - mathclass="topaccent", - mathname="ddot", + mathspec={ + { + class="topaccent", + name="ddot", + }, + { + class="topaccent", + name="wideddot", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x308 }, synonyms={ "spacing diaeresis" }, unicodeslot=0xA8, @@ -1824,10 +1859,20 @@ characters.data={ description="MACRON", direction="on", linebreak="al", - mathclass="topaccent", - mathfiller="barfill", - mathmleq=0x203E, - mathname="bar", +--mathclass="topaccent", +--mathfiller="barfill", +--mathmleq=0x203E, + mathspec={ + { + class="topaccent", + name="bar", + }, + { + class="topaccent", + name="widebar", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x304 }, synonyms={ "apl overbar", "overline", "spacing macron" }, unicodeslot=0xAF, @@ -1886,8 +1931,17 @@ characters.data={ description="ACUTE ACCENT", direction="on", linebreak="bb", - mathclass="topaccent", - mathname="acute", + mathspec={ + { + class="topaccent", + name="acute", + }, + { + class="topaccent", + name="wideacute", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x301 }, synonyms={ "spacing acute accent" }, unicodeslot=0xB4, @@ -2304,7 +2358,7 @@ characters.data={ direction="on", linebreak="ai", mathclass="binary", - mathgroup="nary arithmic", + mathgroup="nary arithmetic", mathname="times", synonyms={ "cartesian product" }, unicodeslot=0xD7, @@ -2704,7 +2758,7 @@ characters.data={ direction="on", linebreak="ai", mathclass="binary", - mathgroup="binary arithmic", + mathgroup="binary arithmetic", mathname="div", synonyms={ "obelus" }, unicodeslot=0xF7, @@ -7650,8 +7704,17 @@ characters.data={ description="MODIFIER LETTER CIRCUMFLEX ACCENT", direction="on", linebreak="al", - mathclass="topaccent", - mathname="hat", + mathspec={ + { + class="topaccent", + name="hat", + }, + { + class="topaccent", + name="widehat", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x302 }, unicodeslot=0x2C6, }, @@ -7664,8 +7727,17 @@ characters.data={ description="CARON", direction="on", linebreak="ai", - mathclass="topaccent", - mathname="check", + mathspec={ + { + class="topaccent", + name="check", + }, + { + class="topaccent", + name="widecheck", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x30C }, synonyms={ "mandarin chinese third tone", "modifier letter hacek" }, unicodeslot=0x2C7, @@ -7814,8 +7886,17 @@ characters.data={ description="BREVE", direction="on", linebreak="ai", - mathclass="topaccent", - mathname="breve", + mathspec={ + { + class="topaccent", + name="breve", + }, + { + class="topaccent", + name="widebreve", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x306 }, unicodeslot=0x2D8, }, @@ -7827,8 +7908,17 @@ characters.data={ description="DOT ABOVE", direction="on", linebreak="ai", - mathclass="topaccent", - mathname="dot", + mathspec={ + { + class="topaccent", + name="dot", + }, + { + class="topaccent", + name="widedot", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x307 }, synonyms={ "mandarin chinese fifth or neutral tone" }, unicodeslot=0x2D9, @@ -7841,8 +7931,17 @@ characters.data={ description="RING ABOVE", direction="on", linebreak="ai", - mathclass="topaccent", - mathname="ring", + mathspec={ + { + class="topaccent", + name="ring", + }, + { + class="topaccent", + name="widering", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x30A }, unicodeslot=0x2DA, }, @@ -7864,8 +7963,17 @@ characters.data={ description="SMALL TILDE", direction="on", linebreak="al", - mathclass="topaccent", - mathname="tilde", + mathspec={ + { + class="topaccent", + name="tilde", + }, + { + class="topaccent", + name="widetilde", + stretch="h", + }, + }, specials={ "compat", 0x20, 0x303 }, unicodeslot=0x2DC, }, @@ -8142,9 +8250,6 @@ characters.data={ description="COMBINING GRAVE ACCENT", direction="nsm", linebreak="cm", - mathclass="topaccent", - mathname="widegrave", - mathstretch="h", synonyms={ "greek varia" }, unicodeslot=0x300, }, @@ -8167,9 +8272,6 @@ characters.data={ description="COMBINING CIRCUMFLEX ACCENT", direction="nsm", linebreak="cm", - mathclass="topaccent", - mathname="widehat", - mathstretch="h", unicodeslot=0x302, }, { @@ -8180,9 +8282,6 @@ characters.data={ description="COMBINING TILDE", direction="nsm", linebreak="cm", - mathclass="topaccent", - mathname="widetilde", - mathstretch="h", unicodeslot=0x303, }, { @@ -62286,7 +62385,8 @@ characters.data={ [0x2012]={ adobename="figuredash", category="pd", - contextname="textminus", + contextname="figuredash", + contextspec={ "textminus" }, description="FIGURE DASH", direction="on", linebreak="ba", @@ -62842,16 +62942,6 @@ characters.data={ description="FRACTION SLASH", direction="cs", linebreak="is", - mathspec={ - { - class="ordinary", - name="slash", - }, - { - class="close", - name="solidus", - }, - }, synonyms={ "solidus" }, unicodeslot=0x2044, }, @@ -66995,7 +67085,7 @@ characters.data={ description="MINUS SIGN", direction="es", linebreak="pr", - mathgroup="binary arithmic", + mathgroup="binary arithmetic", mathspec={ { class="binary", @@ -67004,6 +67094,7 @@ characters.data={ { class="relation", name="relbar", + comment="useless", }, }, unicodeslot=0x2212, @@ -67194,8 +67285,17 @@ characters.data={ description="DIVIDES", direction="on", linebreak="ai", - mathclass="binary", - mathname="divides", + mathspec={ + { + -- class="binary", + class="ordinary", + name="divides", + }, + { + class="relation", + name="mid", + }, + }, synonyms={ "apl stile", "such that" }, unicodeslot=0x2223, }, @@ -67206,7 +67306,8 @@ characters.data={ linebreak="al", mathspec={ { - class="binary", + -- class="binary", + class="ordinary", name="ndivides", }, { diff --git a/tex/context/base/mkiv/char-ini.lua b/tex/context/base/mkiv/char-ini.lua index 09c7994a9..9dcac8033 100644 --- a/tex/context/base/mkiv/char-ini.lua +++ b/tex/context/base/mkiv/char-ini.lua @@ -823,6 +823,7 @@ setmetatableindex(characters.is_command, mti) setmetatableindex(characters.is_spacing, mti) setmetatableindex(characters.is_punctuation,mti) setmetatableindex(characters.is_hyphenator, mti) +setmetatableindex(characters.is_symbol, mti) -- todo: also define callers for the above diff --git a/tex/context/base/mkiv/cldf-ver.lua b/tex/context/base/mkiv/cldf-ver.lua index 7a1c81301..479606f83 100644 --- a/tex/context/base/mkiv/cldf-ver.lua +++ b/tex/context/base/mkiv/cldf-ver.lua @@ -68,8 +68,8 @@ local function flush(s,inline) context.resetbuffer(t_buffer) end -local function t_tocontext(t) - local s = table.serialize(t) +local function t_tocontext(t,s) + local s = table.serialize(t,s) context(function() flush(s,false) end) end diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index e4a711f11..0fc2fe1d6 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{2022.08.05 17:16} +\newcontextversion{2022.08.25 17:38} %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 664316e97..4125a151b 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{2022.08.05 17:16} +\edef\contextversion{2022.08.25 17:38} %D Kind of special: diff --git a/tex/context/base/mkiv/data-tex.lua b/tex/context/base/mkiv/data-tex.lua index 2c1a7dbd5..42547b00b 100644 --- a/tex/context/base/mkiv/data-tex.lua +++ b/tex/context/base/mkiv/data-tex.lua @@ -175,9 +175,10 @@ local function textopener(tag,filename,filehandle,coding) currentline = currentline + 1 -- self.currentline = currentline local content = lines[currentline] --- lines[currentline] = nil + -- lines[currentline] = false if content == "" then - return "" + -- return "" + return content -- elseif content == ctrl_d or ctrl_z then -- return nil -- we need this as \endinput does not work in prints elseif content then diff --git a/tex/context/base/mkiv/font-cff.lua b/tex/context/base/mkiv/font-cff.lua index 4258991c6..114d7dd07 100644 --- a/tex/context/base/mkiv/font-cff.lua +++ b/tex/context/base/mkiv/font-cff.lua @@ -735,8 +735,13 @@ local result = { } local seacs = { } local procidx = nil - local function showstate(where) - report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + local function showstate(where,i,n) + if i then + local j = i + n - 1 + report("%w%-10s : [%s] step",depth*2+2,where,concat(stack," ",i,j <= top and j or top)) + else + report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + end end local function showvalue(where,value,showstack) @@ -873,9 +878,9 @@ local result = { } end end - local function xycurveto(x1,y1,x2,y2,x3,y3) -- called local so no blend here + local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) -- called local so no blend here if trace_charstrings then - showstate("curveto") + showstate("curveto",i,n) end if keepcurve then r = r + 1 @@ -1019,6 +1024,16 @@ local result = { } if trace_charstrings then showstate("rrcurveto") end +if top == 6 then + local ax = x + stack[1] -- dxa + local ay = y + stack[2] -- dya + local bx = ax + stack[3] -- dxb + local by = ay + stack[4] -- dyb + x = bx + stack[5] -- dxc + y = by + stack[6] -- dyc + xycurveto(ax,ay,bx,by,x,y,1,6) +else +-- print("rr",top==6,top) for i=1,top,6 do local ax = x + stack[i] -- dxa local ay = y + stack[i+1] -- dya @@ -1026,8 +1041,9 @@ local result = { } local by = ay + stack[i+3] -- dyb x = bx + stack[i+4] -- dxc y = by + stack[i+5] -- dyc - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end +end top = 0 end @@ -1040,6 +1056,15 @@ local result = { } y = y + stack[1] -- dy1 s = 2 end +if top == 4 then + local ax = x + stack[1] -- dxa + local ay = y + local bx = ax + stack[2] -- dxb + local by = ay + stack[3] -- dyb + x = bx + stack[4] -- dxc + y = by + xycurveto(ax,ay,bx,by,x,y,1,4) +else for i=s,top,4 do local ax = x + stack[i] -- dxa local ay = y @@ -1047,8 +1072,9 @@ local result = { } local by = ay + stack[i+2] -- dyb x = bx + stack[i+3] -- dxc y = by - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top = 0 end @@ -1062,6 +1088,16 @@ local result = { } d = stack[1] -- dx1 s = 2 end +if top == 4 then + local ax = x + d + local ay = y + stack[1] -- dya + local bx = ax + stack[2] -- dxb + local by = ay + stack[3] -- dyb + x = bx + y = by + stack[4] -- dyc + xycurveto(ax,ay,bx,by,x,y,1,4) + d = 0 +else for i=s,top,4 do local ax = x + d local ay = y + stack[i] -- dya @@ -1069,9 +1105,10 @@ local result = { } local by = ay + stack[i+2] -- dyb x = bx y = by + stack[i+3] -- dyc - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) d = 0 end +end top = 0 end @@ -1080,6 +1117,33 @@ local result = { } if last then top = top - 1 end +if top == 4 then + local ax, ay, bx, by + if swap then + ax = x + stack[1] + ay = y + bx = ax + stack[2] + by = ay + stack[3] + y = by + stack[4] + if last then + x = bx + last + else + x = bx + end + else + ax = x + ay = y + stack[1] + bx = ax + stack[2] + by = ay + stack[3] + x = bx + stack[4] + if last then + y = by + last + else + y = by + end + end + xycurveto(ax,ay,bx,by,x,y,1 ,4) +else for i=1,top,4 do local ax, ay, bx, by if swap then @@ -1107,8 +1171,9 @@ local result = { } end swap = true end - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top = 0 end @@ -1137,7 +1202,7 @@ local result = { } local by = ay + stack[i+3] -- dyb x = bx + stack[i+4] -- dxc y = by + stack[i+5] -- dyc - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end x = x + stack[top-1] -- dxc y = y + stack[top] -- dyc @@ -2531,7 +2596,7 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) end end else - -- unsupported format + report("unsupported fd index format %i",format) end -- hm, always if maxindex >= 0 then @@ -2539,21 +2604,30 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) if cidarray then setposition(f,header.offset+cidarray) local dictionaries = readlengths(f,version == "cff2") - for i=1,#dictionaries do - dictionaries[i] = readstring(f,dictionaries[i]) - end - parsedictionaries(data,dictionaries) - cid.dictionaries = dictionaries - readcidprivates(f,data) - for i=1,#dictionaries do - readlocals(f,data,dictionaries[i],version) - end - startparsing(fontdata,data,streams) - for i=1,#charstrings do - parsecharstring(fontdata,data,dictionaries[fdindex[i]+1],charstrings[i],glyphs,i,doshapes,version,streams) --- charstrings[i] = nil + if #dictionaries > 0 then + for i=1,#dictionaries do + dictionaries[i] = readstring(f,dictionaries[i]) + end + parsedictionaries(data,dictionaries) + cid.dictionaries = dictionaries + readcidprivates(f,data) + for i=1,#dictionaries do + readlocals(f,data,dictionaries[i],version) + end + startparsing(fontdata,data,streams) + for i=1,#charstrings do + local dictionary = dictionaries[fdindex[i]+1] + if dictionary then + parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams) + else + -- report("no dictionary for %a : %a => %a",version,i,fdindex[i]+1) + end + -- charstrings[i] = false + end + stopparsing(fontdata,data) + else + report("no cid dictionaries") end - stopparsing(fontdata,data) else report("no cid array") end diff --git a/tex/context/base/mkiv/meta-imp-mat.mkiv b/tex/context/base/mkiv/meta-imp-mat.mkiv index 79757b6a9..66ac33063 100644 --- a/tex/context/base/mkiv/meta-imp-mat.mkiv +++ b/tex/context/base/mkiv/meta-imp-mat.mkiv @@ -139,35 +139,35 @@ enddef ; \stopMPextensions -\startuniqueMPgraphic{minifun::math:stacker:\number"FE3B4}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3B4\else23B4\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_bracket_shape(OverlayHeight,false)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE3B5}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3B5\else23B5\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_bracket_shape(OverlayDepth,true)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DC}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DC\else23DC\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_parent_shape(OverlayHeight,false)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DD}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DD\else23DD\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_parent_shape(OverlayDepth,true)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DE}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DE\else23DE\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_brace_shape(OverlayHeight,false)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DF}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DF\else23DF\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_brace_shape(OverlayDepth,true)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE33E}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE33E\else203E\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_bar_shape(false)) ; \stopuniqueMPgraphic -\startuniqueMPgraphic{minifun::math:stacker:\number"FE33F}{axis,ex,em} +\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE33F\else203F\fi}{axis,ex,em} math_stacker_draw_accent(math_stacker_bar_shape(true)) ; \stopuniqueMPgraphic diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index d2097e7b6..62af2940a 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -173,6 +173,7 @@ return { -- "mathtopaccentcode", "mathbottomaccentcode", "mathdelimitercode", "mathrootcode", "mathprintcode", -- "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", + "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", -- "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", -- @@ -215,7 +216,7 @@ return { "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", - "preferdelimiterdimensionsclassoptioncode", + "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", -- "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", @@ -586,7 +587,7 @@ return { -- "assumelongusagecs", -- - "Umathbotaccent", "Umathtopaccent", + "Umathbottomaccent", "Umathtopaccent", "Umathbotaccent", -- "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index ceaa8d5e7..b0ba0dda7 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -108,6 +108,7 @@ return { "Umathdenominatorvariant", "Umathdict", "Umathdictdef", + "Umathdiscretionary", "Umathextrasubpreshift", "Umathextrasubprespace", "Umathextrasubshift", @@ -233,6 +234,8 @@ return { "Ustopdisplaymath", "Ustopmath", "Ustopmathmode", + "Ustretched", + "Ustretchedwithdelims", "Ustyle", "Usubprescript", "Usubscript", @@ -373,6 +376,7 @@ return { "gtokspre", "hccode", "hjcode", + "hmcode", "hpack", "hyphenationmin", "hyphenationmode", @@ -498,9 +502,9 @@ return { "mathghost", "mathgluemode", "mathgroupingmode", - "mathinlinemainstyle", "mathleftclass", "mathlimitsmode", + "mathmainstyle", "mathmiddle", "mathnolimitsmode", "mathpenaltiesmode", @@ -590,8 +594,6 @@ return { "setmathspacing", "shapingpenaltiesmode", "shapingpenalty", - "skewed", - "skewedwithdelims", "snapshotpar", "supmarkmode", "swapcsvalues", @@ -707,6 +709,7 @@ return { "pdfobjcompresslevel", "pdfomitcharset", "pdfomitcidset", + "pdfomitinfodict", "pdfoutline", "pdfoutput", "pdfpageattr", diff --git a/tex/context/base/mkiv/mult-prm.mkiv b/tex/context/base/mkiv/mult-prm.mkiv index 5ffb84d38..75114c330 100644 --- a/tex/context/base/mkiv/mult-prm.mkiv +++ b/tex/context/base/mkiv/mult-prm.mkiv @@ -68,7 +68,7 @@ "pdftracingfonts", "pdftrailer", "pdftrailerid", "pdfuniformdeviate", "pdfuniqueresname", "pdfvorigin", "pdfxform", "pdfxformattr", "pdfxformmargin", "pdfxformname", "pdfxformresources", "pdfximage", - "pdfomitcidset", "pdfomitcharset", + "pdfomitcidset", "pdfomitcharset", "pdfomitinfodict", }, aleph = { -- we don't bother "Alephminorversion", "Alephrevision", "Alephversion", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 3c36ed7cf..36fa8c14e 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 c57cfee7c..8dbbc4774 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/util-rnd.lua b/tex/context/base/mkiv/util-rnd.lua new file mode 100644 index 000000000..7504965b2 --- /dev/null +++ b/tex/context/base/mkiv/util-rnd.lua @@ -0,0 +1,116 @@ +if not modules then modules = { } end modules ['util-rnd'] = { + version = 1.001, + comment = "companion to luat-lib.mkiv", + author = "Tamara, Adriana, Tomáš Hála & Hans Hagen", + copyright = "ConTeXt Development Team", -- umbrella + license = "see context related readme files" +} + +-- The rounding code is a variant on Tomáš Hála <tomas.hala@mendelu.cz; mendelu@thala.cz> +-- code that is used in the statistical module. We use local variables and a tolerant name +-- resolver that also permits efficient local aliases. With code like this one +-- really have to make sure that locals are used because changing the rounding +-- can influence other code. + +local floor, ceil, pow = math.floor, math.ceil, math.pow +local rawget, type = rawget, type +local gsub, lower = string.gsub, string.lower + +local rounding = { } + +local methods = { + no = function(num) + -- no rounding + return num + end, + up = function(num,coef) + -- ceiling rounding + coef = coef and pow(10,coef) or 1 + return ceil(num * coef) / coef + end, + down = function(num,coef) + -- floor rounding + coef = coef and pow(10,coef) or 1 + return floor(num * coef) / coef + end, + halfup = function(num,coef) + -- rounds decimal numbers as usual, numbers with 0.5 up, too (e.g. number -0.5 will be rounded to 0) + coef = coef and pow(10,coef) or 1 + return floor(num * coef + 0.5) / coef + end, + halfdown = function(num,coef) + -- rounds decimal numbers as usual, numbers with 0.5 down, too (e.g. number 0.5 will be rounded to 0) + coef = coef and pow(10,coef) or 1 + return ceil(num * coef -0.5) / coef + end, + halfabsup = function(num,coef) + -- rounds deciaml numbers as usual, numbers with 0.5 away from zero, e.g. numbers -0.5 and 0.5 will be rounded to -1 and 1 + coef = coef and pow(10,coef) or 1 + return (num >= 0 and floor(num * coef + 0.5) or ceil(num * coef - 0.5)) / coef + end, + halfabsdown = function(num,coef) + -- rounds deciaml numbers as usual, numbers with 0.5 towards zero, e.g. numbers -0.5 and 0.5 will be rounded both to 0 + coef = coef and pow(10,coef) or 1 + return (num < 0 and floor(num * coef + 0.5) or ceil(num * coef - 0.5)) / coef + end, + halfeven = function(num,coef) + -- rounds deciaml numbers as usual, numbers with 0.5 to the nearest even, e.g. numbers 1.5 and 2.5 will be rounded both to 2 + coef = coef and pow(10,coef) or 1 + num = num*coef + return floor(num + (((num - floor(num)) ~= 0.5 and 0.5) or ((floor(num) % 2 == 1) and 1) or 0)) / coef + end, + halfodd = function(num,coef) + -- rounds deciaml numbers as usual, numbers with 0.5 to the nearest odd (e.g. numbers 1.5 and 2.5 will be rounded to 1 and 3 + coef = coef and pow(10,coef) or 1 + num = num * coef + return floor(num + (((num - floor(num)) ~= 0.5 and 0.5) or ((floor(num) % 2 == 1) and 0) or 1)) / coef + end, +} + +methods.default = methods.halfup + +rounding.methods = table.setmetatableindex(methods,function(t,k) + local s = gsub(lower(k),"[^a-z]","") + local v = rawget(t,s) + if not v then + v = t.halfup + end + t[k] = v + return v +end) + +-- If needed I can make a high performance one. + +local defaultmethod = methods.halfup + +rounding.round = function(num,dec,mode) + if type(dec) == "string" then + mode = dec + dec = 1 + end + return (mode and methods[mode] or defaultmethods)(num,dec) +end + +number.rounding = rounding + +-- -- Tomáš' test numbers: + +-- local list = { 5.49, 5.5, 5.51, 6.49, 6.5, 6.51, 0.5, 12.45 } +-- +-- for method, round in table.sortedhash(number.rounding.methods) do +-- for i=1,#list do +-- local n = list[i] +-- print(n,method,round(n,k),round(n,k,3)) +-- end +-- end +-- +-- local myround = number.rounding.methods["HALF ABS DOWN"] +-- +-- for i=1,#list do +-- local n = list[i] +-- print(n,"Half Abs Down",number.rounding.round(n,1,"Half Abs Down")) +-- print(n,"HALF_ABS_DOWN",number.rounding.round(n,1,"HALF_ABS_DOWN")) +-- print(n,"HALF_ABS_DOWN",myround(n,1)) +-- end + +return rounding |