diff options
Diffstat (limited to 'tex')
27 files changed, 541 insertions, 334 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex da86faf6b..dcd95477a 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkiv/char-tex.lua b/tex/context/base/mkiv/char-tex.lua index 562f9c8b8..60f324be2 100644 --- a/tex/context/base/mkiv/char-tex.lua +++ b/tex/context/base/mkiv/char-tex.lua @@ -792,7 +792,7 @@ local function overload(c,u,code,codes)      end      local t = nil      if n == 1 then -        t = u[1] +        t = tonumber(u[1])      else          t = { }          for i=1,n do diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 12e0c7057..c5b7003fc 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@  %C therefore copyrighted by \PRAGMA. See mreadme.pdf for  %C details. -\newcontextversion{2016.04.13 16:46} +\newcontextversion{2016.04.16 15:27}  %D This file is loaded at runtime, thereby providing an excellent place for  %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context-help.lmx b/tex/context/base/mkiv/context-help.lmx index 5f5b5b20a..7d54fca4d 100644 --- a/tex/context/base/mkiv/context-help.lmx +++ b/tex/context/base/mkiv/context-help.lmx @@ -65,6 +65,10 @@                  background-color: #C0C0C0 ;                  color: black;              } +            a.setuplisturl { +                color: #000000 ; +                text-decoration: underline ; +            }              <?lua                  if utilities and utilities.scite and utilities.scite.css then  p(utilities.scite.css()) diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index b2043ced7..02f56afe0 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@  %D up and the dependencies are more consistent.  \edef\contextformat {\jobname} -\edef\contextversion{2016.04.13 16:46} +\edef\contextversion{2016.04.16 15:27}  \edef\contextkind   {beta}  %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua index d08c61eac..f36f75077 100644 --- a/tex/context/base/mkiv/font-con.lua +++ b/tex/context/base/mkiv/font-con.lua @@ -63,8 +63,7 @@ constructors.keys = {      properties = {          encodingbytes          = "number",          embedding              = "number", -        cidinfo                = { -                                 }, +        cidinfo                = { },          format                 = "string",          fontname               = "string",          fullname               = "string", @@ -683,7 +682,7 @@ function constructors.scale(tfmdata,specification)              chr.unicode   = isunicode              chr.tounicode = tounicode(isunicode)              -- in luatex > 0.85 we can do this: --- chr.tounicode = isunicode +            -- chr.tounicode = isunicode          end          if hasquality then              -- we could move these calculations elsewhere (saves calculations) diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua index 77ddea12b..14e816d5e 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -1147,7 +1147,7 @@ local function handlemark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyp                  local b = basecoverage[i]                  if components then                      for c=1,#components do -                        local classes = components[i] +                        local classes = components[c]                          if classes then                              for i=1,nofclasses do                                  local anchor = readanchor(f,classes[i]) diff --git a/tex/context/base/mkiv/font-fbk.lua b/tex/context/base/mkiv/font-fbk.lua index 56f002558..9ef0706d2 100644 --- a/tex/context/base/mkiv/font-fbk.lua +++ b/tex/context/base/mkiv/font-fbk.lua @@ -46,6 +46,9 @@ local force_composed     = false  local cache              = { }  -- we could make these weak  local fraction           = 0.15 -- 30 units for lucida +-- todo: we also need to update the feature hashes ... i'll do that when i'm in the mood +-- and/or when i need it +  local function composecharacters(tfmdata)      -- this assumes that slot 1 is self, there will be a proper self some day      local characters   = tfmdata.characters diff --git a/tex/context/base/mkiv/font-map.lua b/tex/context/base/mkiv/font-map.lua index a91e5234f..ce84ca692 100644 --- a/tex/context/base/mkiv/font-map.lua +++ b/tex/context/base/mkiv/font-map.lua @@ -438,6 +438,95 @@ function mappings.addtounicode(data,filename,checklookups)          checklookups(data,missing,nofmissing)      end      -- todo: go lowercase + +    local unset = { } +    for unic, glyph in next, descriptions do +        if not glyph.unicode and glyph.class == "ligature" then +            unset[unic] = glyph +        end +    end +    if next(unset) then +        local sequences = resources.sequences +        local collected = { } +        for i=1,#sequences do +            local sequence = sequences[i] +            if sequence.type == "gsub_ligature" then +                local steps  = sequence.steps +                if steps then +                    local l = { } +                    local function traverse(p,k,v) +                        if k == "ligature" then +                            collected[v] = { unpack(l) } +                        else +                            table.insert(l,k) +                            for k, vv in next, v do +                                traverse(p,k,vv) +                            end +                            table.remove(l) +                        end +                    end +                    for i=1,#steps do +                    -- we actually had/have this in base mode +                        local coverage = steps[i].coverage +                        if coverage then +                            for k, v in next, coverage do +                                traverse(k,k,v) +                            end +                        end +                    end +                end +            end +        end +        if next(collected) then +            while true do +                local done = false +                for k, v in next, collected do +                    for i=1,#v do +                        local vi = v[i] +                        if vi == k then +                            collected[k] = nil +                            unset[k] = nil +                        else +                            local c = collected[vi] +                            if c then +                                done = true +                                local t = { } +                                local n = i - 1 +                                for j=1,n do +                                    t[j] = t[j] +                                end +                                for j=1,#c do +                                    n = n + 1 +                                    t[n] = c[j] +                                end +                                for j=i+1,#v do +                                    n = n + 1 +                                    t[n] = t[j] +                                end +                                collected[k] = t +                                break +                            end +                        end +                    end +                end +                if not done then +                    break +                end +            end +            local n = 0 +            for k, v in next, unset do +                u = collected[k] +                if u then +                    v.unicode = u +                    n = n + 1 +                end +            end +            if trace_mapping and n > 0 then +                report_fonts("%n ligature tounicode mappings deduced from gsub ligature feaures",n) +            end +        end +    end +      if trace_mapping then          for unic, glyph in table.sortedhash(descriptions) do              local name    = glyph.name diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua index 7d73b457e..9d9c39c58 100644 --- a/tex/context/base/mkiv/font-mis.lua +++ b/tex/context/base/mkiv/font-mis.lua @@ -22,7 +22,7 @@ local handlers = fonts.handlers  handlers.otf   = handlers.otf or { }  local otf      = handlers.otf -otf.version    = otf.version or 2.823 +otf.version    = otf.version or 2.824  otf.cache      = otf.cache   or containers.define("fonts", "otf", otf.version, true)  local fontloader    = fontloader diff --git a/tex/context/base/mkiv/font-otd.lua b/tex/context/base/mkiv/font-otd.lua index db041c722..2257caa8c 100644 --- a/tex/context/base/mkiv/font-otd.lua +++ b/tex/context/base/mkiv/font-otd.lua @@ -133,6 +133,8 @@ local wildcard = "*"  -- what about analyze in local and not in font +-- needs checking: some added features can pass twice +  local function initialize(sequence,script,language,s_enabled,a_enabled,font,attr,dynamic,ra,autoscript,autolanguage)      local features = sequence.features      if features then diff --git a/tex/context/base/mkiv/font-otf.lua b/tex/context/base/mkiv/font-otf.lua index e71a57cbe..cbdc79678 100644 --- a/tex/context/base/mkiv/font-otf.lua +++ b/tex/context/base/mkiv/font-otf.lua @@ -58,7 +58,7 @@ local otf                = fonts.handlers.otf  otf.glists               = { "gsub", "gpos" } -otf.version              = 2.823 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version              = 2.824 -- beware: also sync font-mis.lua and in mtx-fonts  otf.cache                = containers.define("fonts", "otf", otf.version, true)  local hashes             = fonts.hashes diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua index 0deb4bce0..210abfe48 100644 --- a/tex/context/base/mkiv/font-otl.lua +++ b/tex/context/base/mkiv/font-otl.lua @@ -53,7 +53,7 @@ local report_otf         = logs.reporter("fonts","otf loading")  local fonts              = fonts  local otf                = fonts.handlers.otf -otf.version              = 3.016 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version              = 3.017 -- beware: also sync font-mis.lua and in mtx-fonts  otf.cache                = containers.define("fonts", "otl", otf.version, true)  local otfreaders         = otf.readers diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua index d67db6dd6..2e648c0c8 100644 --- a/tex/context/base/mkiv/font-ots.lua +++ b/tex/context/base/mkiv/font-ots.lua @@ -2385,7 +2385,6 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)                                      end                                      break                                  end -                                current = getnext(current)                              elseif char == false then                                  if discfound then                                      notmatchreplace[discfound] = true diff --git a/tex/context/base/mkiv/luat-run.lua b/tex/context/base/mkiv/luat-run.lua index 54450b28d..7e81350f0 100644 --- a/tex/context/base/mkiv/luat-run.lua +++ b/tex/context/base/mkiv/luat-run.lua @@ -25,9 +25,11 @@ local luatex = luatex  local startactions = { }  local stopactions  = { } +local dumpactions  = { }  function luatex.registerstartactions(...) insert(startactions, ...) end  function luatex.registerstopactions (...) insert(stopactions,  ...) end +function luatex.registerdumpactions (...) insert(dumpactions,  ...) end  local function start_run()      if logs.start_run then @@ -76,6 +78,9 @@ end  -- end  local function pre_dump_actions() +    for i=1,#dumpactions do +        dumpactions[i]() +    end      lua.finalize(trace_lua_dump and report_lua or nil)   -- statistics.savefmtstatus("\jobname","\contextversion","context.tex")  end diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua index 24c602729..332f3d230 100644 --- a/tex/context/base/mkiv/mult-def.lua +++ b/tex/context/base/mkiv/mult-def.lua @@ -17200,6 +17200,15 @@ return {     ["nl"]="naam",     ["ro"]="csname",    }, +  ["cd:delimiter"]={ +   ["cs"]="delimiter", +   ["de"]="delimiter", +   ["en"]="delimiter", +   ["fr"]="delimiter", +   ["it"]="delimiter", +   ["nl"]="delimiter", +   ["ro"]="delimiter", +  },    ["cd:destination"]={     ["cs"]="destination",     ["de"]="destination", @@ -17623,52 +17632,71 @@ return {     ["nl"]="xmlsetup",     ["ro"]="xmlsetup",    }, -  ["s:sign"]                    = { en = "[-+]" }, -  ["s:noargument"]              = { en = "\\..." }, -  ["s:oneargument"]             = { en = "\\...#1" }, -  ["s:twoarguments"]            = { en = "\\...#1#2" }, -  ["s:threearguments"]          = { en = "\\...#1#2#3" }, -  ["s:braces"]                  = { en = "{...}" }, -  ["l:braces"]                  = { en = "{...,...}" }, -  ["s:brackets"]                = { en = "[...]" }, -  ["l:brackets"]                = { en = "[...,...]" }, -  ["s:index"]                   = { en = "[...]" }, -  ["l:index"]                   = { en = "[..+...+..]" }, -  ["s:math"]                    = { en = "$...$" }, -  ["s:inlinemath"]              = { en = "$...$" }, -  ["s:displaymath"]             = { en = "$$...$$" }, -  ["s:template"]                = { en = "[|...|]" }, -  ["l:template"]                = { en = "[|...|...|]" }, -  ["s:twowords"]                = { en = "[..+..]" }, -  ["s:threewords"]              = { en = "[..+..+..]" }, -  ["s:angle"]                   = { en = "<<...>>" }, -  ["s:reference"]               = { en = "[...]" }, -  ["l:reference"]               = { en = "[...,...]" }, -  ["s:position"]                = { en = "(...)" }, -  ["l:position"]                = { en = "(...,...)" }, -  ["s:triplet"]                 = { en = "[x:y:z=]" }, -  ["l:triplet"]                 = { en = "[x:y:z=,..]" }, -  ["s:word"]                    = { en = "{...}" }, -  ["l:word"]                    = { en = "{.. ... ..}" }, -  ["s:content"]                 = { en = "{...}" }, -  ["l:content"]                 = { en = "{.. ... ..}" }, -  ["s:textual"]                 = { en = "..." }, -  ["l:textual"]                 = { en = ".. ... .." }, -  ["s:none"]                    = { en = "..." }, -  ["l:none"]                    = { en = ".. ... .." }, -  ["s:macro"]                   = { en = "\\... " }, -  ["s:to"]                      = { en = "\\to " }, -  ["s:destination"]             = { en = "[{..[ref]}]" }, -  ["l:destination"]             = { en = "[..,{..[ref,..]},..]" }, -  ["s:nothing"]                 = { en = "..." }, -  ["s:file"]                    = { en = " ... " }, -  ["s:bracedassignment"]        = { en = "{..=..}" }, -  ["l:bracedassignment"]        = { en = "{..,..=..,..}" }, -  ["s:bracketedassignment"]     = { en = "[..=..]" }, -  ["l:bracketedassignment"]     = { en = "[..,..=..,..]" }, -  ["s:parenthesizedassignment"] = { en = "[..=..]" }, -  ["l:parenthesizedassignment"] = { en = "[..,..=..,..]" }, -  ["s:apply"]                   = { en = "[..=>..]" }, -  ["l:apply"]                   = { en = "[..,..=>..,..]" }, +  ["cd:sign-s"]                    = { en = "[-+]" }, +  ["cd:sign-l"]                    = { en = "[-+]" }, +  ["cd:csname-s"]                  = { en = "\\..." }, +  ["cd:csname-l"]                  = { en = "\\..." }, +  ["cd:noargument-s"]              = { en = "\\..." }, +  ["cd:noargument-l"]              = { en = "\\..." }, +  ["cd:oneargument-s"]             = { en = "\\...#1" }, +  ["cd:oneargument-l"]             = { en = "\\...#1" }, +  ["cd:twoarguments-s"]            = { en = "\\...#1#2" }, +  ["cd:twoarguments-l"]            = { en = "\\...#1#2" }, +  ["cd:threearguments-s"]          = { en = "\\...#1#2#3" }, +  ["cd:threearguments-l"]          = { en = "\\...#1#2#3" }, +  ["cd:braces-s"]                  = { en = "{...}", lua = '"..."' }, +  ["cd:braces-l"]                  = { en = "{...,...}", lua = '".. ... .."' }, +  ["cd:brackets-s"]                = { en = "[...]", lua = "{ ... }" }, +  ["cd:brackets-l"]                = { en = "[...,...]", lua = "{..., ...}" }, +  ["cd:index-s"]                   = { en = "[...]" }, +  ["cd:index-l"]                   = { en = "[..+...+..]" }, +  ["cd:math-s"]                    = { en = "$...$" }, +  ["cd:math-l"]                    = { en = "$...$" }, +  ["cd:inlinemath-s"]              = { en = "$...$" }, +  ["cd:inlinemath-l"]              = { en = "$...$" }, +  ["cd:displaymath-s"]             = { en = "$$...$$" }, +  ["cd:displaymath-l"]             = { en = "$$...$$" }, +  ["cd:template-s"]                = { en = "[|...|]" }, +  ["cd:template-l"]                = { en = "[|...|...|]" }, +  ["cd:twowords-s"]                = { en = "[..+..]" }, +  ["cd:twowords-l"]                = { en = "[..+..]" }, +  ["cd:threewords-s"]              = { en = "[..+..+..]" }, +  ["cd:threewords-l"]              = { en = "[..+..+..]" }, +  ["cd:angle-s"]                   = { en = "<<...>>" }, +  ["cd:angle-l"]                   = { en = "<<...>>" }, +  ["cd:reference-s"]               = { en = "[...]", lua = "{ ... }" }, +  ["cd:reference-l"]               = { en = "[...,...]", lua = "{..., ...}" }, +  ["cd:position-s"]                = { en = "(...)" }, +  ["cd:position-l"]                = { en = "(...,...)" }, +  ["cd:triplet-s"]                 = { en = "[x:y:z]" }, +  ["cd:triplet-l"]                 = { en = "[x:y:z,..]" }, +  ["cd:word-s"]                    = { en = "{...}", lua = '"..."' }, +  ["cd:word-l"]                    = { en = "{.. ... ..}", lua = '".. ... .."' }, +  ["cd:content-s"]                 = { en = "{...}", lua = '"..."' }, +  ["cd:content-l"]                 = { en = "{.. ... ..}", lua = '".. ... .."' }, +  ["cd:textual-s"]                 = { en = "..." }, +  ["cd:textual-l"]                 = { en = ".. ... .." }, +  ["cd:none-s"]                    = { en = "..." }, +  ["cd:none-l"]                    = { en = ".. ... .." }, +  ["cd:macro-s"]                   = { en = "\\... " }, +  ["cd:macro-l"]                   = { en = "\\... " }, +  ["cd:to-s"]                      = { en = "\\to " }, +  ["cd:to-l"]                      = { en = "\\to " }, +  ["cd:destination-s"]             = { en = "[{..[ref]}]" }, +  ["cd:destination-l"]             = { en = "[..,{..[ref,..]},..]" }, +  ["cd:nothing-s"]                 = { en = "..." }, +  ["cd:nothing-l"]                 = { en = "..." }, +  ["cd:file-s"]                    = { en = " ... " }, +  ["cd:file-l"]                    = { en = " ... " }, +  ["cd:assignment-s"]              = { en = "[..=..]", lua = "{ ..=.. } " }, +  ["cd:assignment-l"]              = { en = "[..,..=..,..]", lua = "{ ..,..=..,.. } " }, +  ["cd:assignmentbraces-s"]        = { en = "{..=..}" }, +  ["cd:assignmentbraces-l"]        = { en = "{..,..=..,..}" }, +  ["cd:assignmentbrackets-s"]      = { en = "[..=..]", lua = "{ ..=.. } " }, +  ["cd:assignmentbrackets-l"]      = { en = "[..,..=..,..]", lua = "{ ..,..=..,.. } " }, +  ["cd:assignmentparentheses-s"]   = { en = "(..=..)" }, +  ["cd:assignmentparentheses-l"]   = { en = "(..,..=..,..)" }, +  ["cd:apply-s"]                   = { en = "[..=>..]" }, +  ["cd:apply-l"]                   = { en = "[..,..=>..,..]" },   }  } diff --git a/tex/context/base/mkiv/mult-ini.lua b/tex/context/base/mkiv/mult-ini.lua index 3fb5416ba..409c735b7 100644 --- a/tex/context/base/mkiv/mult-ini.lua +++ b/tex/context/base/mkiv/mult-ini.lua @@ -215,6 +215,8 @@ function interfaces.setuserinterface(interface,response)      sharedstorage.currentinterface, currentinterface = interface, interface      sharedstorage.currentresponse, currentresponse = response, response      if environment.initex then +        local setmacro        = false +     -- local setmacro        = interfaces.setmacro -- cleaner (but we need to test first)          local nofconstants    = 0          local nofvariables    = 0          local nofelements     = 0 @@ -222,49 +224,91 @@ function interfaces.setuserinterface(interface,response)          local nofformats      = 0          local noftranslations = 0          local nofsetupstrings = 0 -        local t, n, f, s          -- -        t, n, f, s = { }, 0, formatters["\\ui_c{%s}{%s}"], formatters["\\ui_s{%s}"] -        for given, constant in next, complete.constants do -            constant = constant[interface] or constant.en or given -            constants[constant] = given -- breedte -> width -            nofconstants = nofconstants + 1 -            if given == constant then -                t[nofconstants] = s(given) -            else -                t[nofconstants] = f(given,constant) +        if setmacro then +            for given, constant in next, complete.constants do +                constant = constant[interface] or constant.en or given +                constants[constant] = given -- breedte -> width +                nofconstants = nofconstants + 1 +                setmacro("c!"..given,given) +                if currentinterface ~= "en" then +                    setmacro("k!"..constant,given) +                end +            end +        else +            local t, f, s = { }, formatters["\\ui_c{%s}{%s}"], formatters["\\ui_s{%s}"] +            for given, constant in next, complete.constants do +                constant = constant[interface] or constant.en or given +                constants[constant] = given -- breedte -> width +                nofconstants = nofconstants + 1 +                if given == constant then +                    t[nofconstants] = s(given) +                else +                    t[nofconstants] = f(given,constant) +                end              end +            contextsprint(prtcatcodes,concat(t))          end -        contextsprint(prtcatcodes,concat(t))          -- -        t, n, f = { }, 0, formatters["\\ui_v{%s}{%s}"] -        for given, variable in next, complete.variables do -            variable = variable[interface] or variable.en or given -            variables[given] = variable -- ja -> yes -            nofvariables = nofvariables + 1 -            t[nofvariables] = f(given,variable) +        if setmacro then +            for given, variable in next, complete.variables do +                variable = variable[interface] or variable.en or given +                variables[given] = variable -- ja -> yes +                nofvariables = nofvariables + 1 +                setmacro("v!"..given,variable) +            end +        else +            local t, f = { }, formatters["\\ui_v{%s}{%s}"] +            for given, variable in next, complete.variables do +                variable = variable[interface] or variable.en or given +                variables[given] = variable -- ja -> yes +                nofvariables = nofvariables + 1 +                t[nofvariables] = f(given,variable) +            end +            contextsprint(prtcatcodes,concat(t))          end -        contextsprint(prtcatcodes,concat(t))          -- -        t, n, f = { }, 0, formatters["\\ui_e{%s}{%s}"] -        for given, element in next, complete.elements do -            element = element[interface] or element.en or given -            elements[element] = given -            nofelements = nofelements + 1 -            t[nofelements] = f(given,element) +        if setmacro then +            for given, element in next, complete.elements do +                element = element[interface] or element.en or given +                elements[element] = given +                nofelements = nofelements + 1 +                setmacro("e!"..given,element) +            end +        else +            local t, f = { }, formatters["\\ui_e{%s}{%s}"] +            for given, element in next, complete.elements do +                element = element[interface] or element.en or given +                elements[element] = given +                nofelements = nofelements + 1 +                t[nofelements] = f(given,element) +            end +            contextsprint(prtcatcodes,concat(t))          end -        contextsprint(prtcatcodes,concat(t))          -- -        t, n, f = { }, 0, formatters["\\ui_m{%s}{%s}"] -        for given, command in next, complete.commands do -            command = command[interface] or command.en or given -            if command ~= given then -                n = n + 1 -                t[n] = f(given,command) +        if setmacro then +            -- this can only work ok when we already have defined the command +            luatex.registerdumpactions(function() +                for given, command in next, complete.commands do +                    command = command[interface] or command.en or given +                    if command ~= given then +                        setmacro(prtcatcodes,given,"\\"..command) +                    end +                    nofcommands = nofcommands + 1 +                end +            end) +        else +            local t, n, f = { }, 0, formatters["\\ui_m{%s}{%s}"] +            for given, command in next, complete.commands do +                command = command[interface] or command.en or given +                if command ~= given then +                    n = n + 1 +                    t[n] = f(given,command) +                end +                nofcommands = nofcommands + 1              end -            nofcommands = nofcommands + 1 +            contextsprint(prtcatcodes,concat(t))          end -        contextsprint(prtcatcodes,concat(t))          --          for given, format in next, complete.messages.formats do              formats[given] = format[interface] or format.en or given diff --git a/tex/context/base/mkiv/mult-ini.mkiv b/tex/context/base/mkiv/mult-ini.mkiv index 8675834a5..8ed147c63 100644 --- a/tex/context/base/mkiv/mult-ini.mkiv +++ b/tex/context/base/mkiv/mult-ini.mkiv @@ -804,9 +804,9 @@  % \stopinterface  \def\ui_c#1#2{\expandafter\gdef\csname\c!prefix!#1\endcsname{#1}% -                \expandafter\gdef\csname\k!prefix!#2\endcsname{#1}} % backmapping from non english +              \expandafter\gdef\csname\k!prefix!#2\endcsname{#1}} % backmapping from non english  \def\ui_s  #1{\expandafter\gdef\csname\c!prefix!#1\endcsname{#1}% -                \expandafter\gdef\csname\k!prefix!#1\endcsname{#1}} % backmapping from non english +              \expandafter\gdef\csname\k!prefix!#1\endcsname{#1}} % backmapping from non english  \def\ui_v#1#2{\expandafter\gdef\csname\v!prefix!#1\endcsname{#2}}  \def\ui_e#1#2{\expandafter\gdef\csname\e!prefix!#1\endcsname{#2}}  \def\ui_m#1#2{\expandafter\gdef\csname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}} diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex b39796806..d775f0087 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 eb4cadf97..2d597ef30 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/trac-inf.lua b/tex/context/base/mkiv/trac-inf.lua index f4c4e5557..401fd01e7 100644 --- a/tex/context/base/mkiv/trac-inf.lua +++ b/tex/context/base/mkiv/trac-inf.lua @@ -14,7 +14,7 @@ if not modules then modules = { } end modules ['trac-inf'] = {  local type, tonumber, select = type, tonumber, select  local format, lower, find = string.format, string.lower, string.find  local concat = table.concat -local clock = os.gettimeofday or os.clock -- should go in environment +local clock  = os.gettimeofday or os.clock -- should go in environment  local setmetatableindex = table.setmetatableindex  local serialize         = table.serialize diff --git a/tex/context/base/mkiv/typo-bld.lua b/tex/context/base/mkiv/typo-bld.lua index ab57a46f7..006576f88 100644 --- a/tex/context/base/mkiv/typo-bld.lua +++ b/tex/context/base/mkiv/typo-bld.lua @@ -52,7 +52,8 @@ storage.register("builders/paragraphs/constructors/numbers", numbers, "builders.  local trace_page_builder = false  trackers.register("builders.page", function(v) trace_page_builder = v end)  local trace_post_builder = false  trackers.register("builders.post", function(v) trace_post_builder = v end) -local report_parbuilders = logs.reporter("parbuilders") +local report_par_builder  = logs.reporter("builders","par") +local report_page_builder = logs.reporter("builders","page")  local mainconstructor = nil -- not stored in format  local nofconstructors = 0 @@ -84,7 +85,7 @@ function constructors.start(name)      if mainconstructor ~= unsetvalue then          constructors.enable()      end - -- report_parbuilders("start %a",name) + -- report_par_builder("start %a",name)  end  function constructors.stop() @@ -94,7 +95,7 @@ function constructors.stop()      if mainconstructor == unsetvalue then          constructors.disable()      end - -- report_parbuilders("stop") + -- report_par_builder("stop")  end  -- return values: @@ -115,7 +116,7 @@ function constructors.handler(head,followed_by_display)                  if handler then                      return handler(head,followed_by_display)                  else -                    report_parbuilders("contructor method %a is not defined",tostring(method)) +                    report_par_builder("contructor method %a is not defined",tostring(method))                      return true -- let tex break                  end              end diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 9aa19b30c..7149f966c 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 809d8caad..e4273d667 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/modules/mkiv/s-lingual-de.mkiv b/tex/context/modules/mkiv/s-lingual-de.mkiv new file mode 100644 index 000000000..f01afa468 --- /dev/null +++ b/tex/context/modules/mkiv/s-lingual-de.mkiv @@ -0,0 +1,32 @@ +% Some experimental code for Wolfgang to play with: + +\startluacode +    fonts.handlers.otf.addfeature { +        name = "sz", +        type = "multiple", +        data = { +            ["ẞ"] = { "S", "S" } +        } +    } +\stopluacode + +\definefontfeature[sz][sz=yes] + +\unexpanded\def\composedSZ  {\overloaduppercase{0xDF}{0x1E9E}} +\unexpanded\def\decomposedSZ{\overloaduppercase{0xDF}{0x53,0x53}} + +\continueifinputfile{s-lingual-de.mkiv} + +\setupbodyfont[libertine] + +\starttext +   %\definefontfeature[default][default][sz=yes] +    \dorecurse{10} { +        \decomposedSZ \WORD{Gruß}\par +        \composedSZ   \WORD{Gruß}\par +    } + +    \composedSZ +    {\addfeature{sz}Straße \WORD{Straße} STRAẞE}\par +    {Straße \WORD{Straße} STRAẞE}\par +\stoptext diff --git a/tex/context/modules/mkiv/x-setups-basics.mkiv b/tex/context/modules/mkiv/x-setups-basics.mkiv index da4bc3262..326323259 100644 --- a/tex/context/modules/mkiv/x-setups-basics.mkiv +++ b/tex/context/modules/mkiv/x-setups-basics.mkiv @@ -18,6 +18,40 @@  \unprotect +\defineregister +  [texmacro] +% [texmacros] + +\definesorting +  [texcommand] +% [texcommands] + +\setupsorting +  [texcommand] +  [\c!command=\showsetupinlist, +   \c!criterium=\setupparameter\c!criterium] + +\pushmacro\setuptext + +\defineframedtext +  [setuptext] +  [\c!width=\hsize, +   \c!height=\v!fit, +   \c!align=\v!right, +   \c!offset=0.75\emwidth] + +\popmacro\setuptext + +\installcorenamespace{interfacesetup} + +\installsetuponlycommandhandler \??interfacesetup {setup} % \??interfacesetup + +\setupsetup +  [\c!before=, +   \c!after=, +   \c!command=\setup, +   \c!criterium=\v!used] +  % general  \unexpanded\def\setupnumfont {} @@ -32,10 +66,6 @@  \unexpanded\def\setupintword#1{\WORD{\detokenize{#1}}}  \unexpanded\def\setuptxtword#1{\detokenize{#1}} -\installcorenamespace{interfacesetup} - -\installsetuponlycommandhandler \??interfacesetup {setup} % \??interfacesetup -  \unexpanded\def\cmd_internal_value#1%    {\dontleavehmode     \begingroup @@ -49,31 +79,9 @@     \endgroup}  \unexpanded\def\cmd_command_value#1% -  {{\setupvarfont{#1}}} - -\defineregister -  [texmacro] -% [texmacros] - -\definesorting -  [texcommand] -% [texcommands] - -\setupsorting -  [texcommand] -  [\c!command=\showsetupinlist, -   \c!criterium=\setupparameter\c!criterium] - -\pushmacro\setuptext - -\defineframedtext -  [setuptext] -  [\c!width=\hsize, -   \c!height=\v!fit, -   \c!align=\v!right, -   \c!offset=0.75\emwidth] - -\popmacro\setuptext +  {\begingroup +   \setupvarfont{#1}% +   \endgroup}  %D Loading: @@ -207,23 +215,16 @@          context(n)      end -    local cmd = table.tohash { -        "cd:noargument", -        "cd:oneargument", -        "cd:twoarguments", -        "cd:threearguments", -    } -      interfaces.implement {          name      = "getsetupstring",          actions   = function(s)              local g = getsetupstring(s)              if not find(s,"^cd:") then                  setuptxtword(g) -            elseif cmd[s] then +            elseif find(s,"%-.$") then                  setupvarword(g)              else -                setupintword(g) +                setupintword(g) -- cap              end          end,          overload  = true, @@ -271,24 +272,28 @@           \xmlfilter{setups:#1}{/interface//command/command(xml:setups:register)}%        }}} -\newconstant\kindofsetup - -\unexpanded\def\basicsetup{\kindofsetup\zerocount\cmd_show_setup} -\unexpanded\def\shortsetup{\kindofsetup\plusone  \cmd_show_setup} -\unexpanded\def\setup     {\kindofsetup\plustwo  \cmd_show_setup} -\unexpanded\def\showsetup {\kindofsetup\plustwo  \cmd_show_setup} +\newconstant   \c_cmd_kind +\newconditional\c_cmd_doing_line +\newconditional\c_cmd_measuring +\newconditional\c_cmd_show_setup +\newcount      \c_cmd_current_argument +\newcount      \c_cmd_maximum_argument +\newdimen      \d_cmd_current_width +\let           \m_cmd_current_hash      \empty +\let           \m_cmd_current_file      \empty + +\unexpanded\def\basicsetup{\c_cmd_kind\zerocount\cmd_show_setup} +\unexpanded\def\shortsetup{\c_cmd_kind\plusone  \cmd_show_setup} +\unexpanded\def\setup     {\c_cmd_kind\plustwo  \cmd_show_setup} +\unexpanded\def\showsetup {\c_cmd_kind\plustwo  \cmd_show_setup}  \unexpanded\def\showsetupinlist#1#2#3% -  {\kindofsetup\plustwo\xmlsetup{#3}{xml:setups:typeset}\par} - -% todo: only references in lists - -\newconditional\c_cmd_showsetup +  {\c_cmd_kind\plustwo\xmlsetup{#3}{xml:setups:typeset}\par}  \installtextracker    {cmd.showsetup} -  {\settrue\c_cmd_showsetup} -  {\setfalse\c_cmd_showsetup} +  {\settrue\c_cmd_show_setup} +  {\setfalse\c_cmd_show_setup}  \unexpanded\def\cmd_show_setup    {\doifelsenextoptionalcs\cmd_show_setup_yes\cmd_show_setup_nop} @@ -302,7 +307,7 @@  \def\cmd_show_setup_nop#1% this will trigger 'used'    {\registersort[texcommand][stp:x:#1]% -   \ifconditional\c_cmd_showsetup +   \ifconditional\c_cmd_show_setup       \writestatus{setup}{#1 / \rawsynonymname{texcommand}{stp:x:#1}}%     \fi     \startelement[setup][name=#1]% @@ -319,15 +324,6 @@  %D Typesetting: -% \setupxml -%   [\c!default=\v!hidden, % ignore elements that are not defined -%    \c!compress=\v!yes] - -\newcounter\currentSETUPargument -\newcounter\maximumSETUPargument - -\def\currentSETUPwidth{0pt} -  \startxmlsetups xml:setups:typeset      \doifelsenothing {#1} {          \xmlsetup{#1}{xml:setups:typeset:nop} @@ -345,9 +341,9 @@  \startxmlsetups xml:setups:typeset:line      \ttbf      \nohyphens -    \edef\currentSETUPhash{\xmlatt{#1}{hash}} +    \edef\m_cmd_current_hash{\xmlatt{#1}{hash}}      \bgroup -        \enablemode[setups-pass-one]% +        \settrue\c_cmd_doing_line          \doif {\xmlatt{#1}{generated}} {yes} {              \ttbs          } @@ -368,15 +364,15 @@      \egroup      \xmldoif{#1}{/arguments} {          \bgroup -            \enablemode[setups-pass-one] -            \doglobal\newcounter\currentSETUPargument +            \settrue\c_cmd_doing_line +            \global\c_cmd_current_argument\zerocount              \ignorespaces              \xmlfilter{#1}{/arguments/text()}          \egroup      }      \doif {\xmlatt{#1}{type}} {environment} {          \bgroup -            \enablemode[setups-pass-one]% +            \settrue\c_cmd_doing_line              \hskip.5em\unknown\hskip.5em              \doif {\xmlatt{#1}{generated}} {yes} {                  \ttbs @@ -397,18 +393,17 @@      }  \stopxmlsetups -\let\currentSETUPfilename\empty -  \startxmlsetups xml:setups:typeset:raw      \tttf      \nohyphens      \veryraggedright -    \doglobal\newcounter\currentSETUPargument -    \xdef\maximumSETUPargument{\xmlfilter{#1}{/arguments/*/s_count()}} -    \edef\currentSETUPhash{\xmlatt{#1}{hash}} -    \xdef\currentSETUPfilename{\xmlatt{#1}{file}}% +    \global\c_cmd_current_argument\zerocount +    \global\c_cmd_maximum_argument\xmlfilter{#1}{/arguments/*/s_count()}\relax +    \edef\m_cmd_current_hash{\xmlatt{#1}{hash}} +    \xdef\m_cmd_current_file{\xmlatt{#1}{file}}% +    % can be made faster :      \bgroup -        \enablemode[setups-pass-one]% +        \settrue\c_cmd_doing_line          \doif {\xmlatt{#1}{generated}} {yes} {              \ttsl          } @@ -428,16 +423,16 @@          \ignorespaces      \egroup      \xmldoif{#1}{/arguments} { +        \settrue\c_cmd_doing_line          \bgroup -            \enablemode[setups-pass-one] -            \doglobal\newcounter\currentSETUPargument +            \global\c_cmd_current_argument\zerocount              \ignorespaces              \xmlfilter{#1}{/arguments/text()}          \egroup      }      \doif {\xmlatt{#1}{type}} {environment} { +        \settrue\c_cmd_doing_line          \bgroup -            \enablemode[setups-pass-one]%              \hskip.5em\unknown\hskip.5em              \doif {\xmlatt{#1}{generated}} {yes} {                  \ttsl @@ -461,8 +456,8 @@  \startxmlsetups xml:setups:typeset:detail      \xmldoif{#1}{/arguments} {          \bgroup -            \enablemode[setups-pass-two] -            \doglobal\newcounter\currentSETUPargument +            \setfalse\c_cmd_doing_line +            \global\c_cmd_current_argument\zerocount             %\blank[\v!line] % packed mode (we could do \startunpacked ...)              \godown[.75\lineheight]              \switchtobodyfont[\v!small] @@ -472,8 +467,8 @@  \stopxmlsetups  \startxmlsetups xml:setups:typeset:yes -    \glet\currentSETUPfilename\empty -    \ifcase\kindofsetup +    \glet\m_cmd_current_file\empty +    \ifcase\c_cmd_kind          \xmlsetup{#1}{xml:setups:typeset:line}      \or          \getvalue{\e!start setuptext} @@ -486,7 +481,7 @@          \xmlsetup{#1}{xml:setups:typeset:detail}          \getvalue{\e!stop setuptext}      \fi -    \glet\currentSETUPfilename\empty +    \glet\m_cmd_current_file\empty  \stopxmlsetups  \defineoverlay @@ -498,16 +493,10 @@        \hbox to \overlaywidth          {\strut           \hss -         \currentSETUPfilename +         \m_cmd_current_file           \hskip\dimexpr\scratchdimen+\strutdp\relax}%        \vskip\scratchdimen}] -\setupsetup -  [\c!before=, -   \c!after=, -   \c!command=\setup, -   \c!criterium=\v!used] -  \startxmlsetups xml:setups:resolve      \ignorespaces      \ctxlua{moduledata.setups.resolved('\xmlatt{#1}{name}')} @@ -528,40 +517,42 @@      \xmlatt{#1}{value}\ignorespaces  \stopxmlsetups -\startxmlsetups xml:setups:content     \showSETUPcomponent{#1}{content}    {content}    \stopxmlsetups -\startxmlsetups xml:setups:displaymath \showSETUPcomponent{#1}{displaymath}{displaymath}\stopxmlsetups -\startxmlsetups xml:setups:index       \showSETUPcomponent{#1}{index}      {index}      \stopxmlsetups -\startxmlsetups xml:setups:math        \showSETUPcomponent{#1}{math}       {math}       \stopxmlsetups -\startxmlsetups xml:setups:nothing     \showSETUPcomponent{#1}{nothing}    {nothing}    \stopxmlsetups -\startxmlsetups xml:setups:file        \showSETUPcomponent{#1}{file}       {file}       \stopxmlsetups -\startxmlsetups xml:setups:position    \showSETUPcomponent{#1}{position}   {position}   \stopxmlsetups -\startxmlsetups xml:setups:reference   \showSETUPcomponent{#1}{reference}  {reference}  \stopxmlsetups -\startxmlsetups xml:setups:csname      \showSETUPcomponent{#1}{csname}     {csname}     \stopxmlsetups -\startxmlsetups xml:setups:destination \showSETUPcomponent{#1}{destination}{destination}\stopxmlsetups -\startxmlsetups xml:setups:triplet     \showSETUPcomponent{#1}{triplet}    {triplet}    \stopxmlsetups -\startxmlsetups xml:setups:word        \showSETUPcomponent{#1}{word}       {word}       \stopxmlsetups -\startxmlsetups xml:setups:template    \showSETUPcomponent{#1}{template}   {template}   \stopxmlsetups -\startxmlsetups xml:setups:angles      \showSETUPcomponent{#1}{angles}     {angles}     \stopxmlsetups -\startxmlsetups xml:setups:apply       \showSETUPcomponent{#1}{apply}      {apply}      \stopxmlsetups -\startxmlsetups xml:setups:twowords    \showSETUPcomponent{#1}{twowords}   {twowords}   \stopxmlsetups -\startxmlsetups xml:setups:threewords  \showSETUPcomponent{#1}{threewords} {threewords} \stopxmlsetups -\startxmlsetups xml:setups:text        \showSETUPcomponent{#1}{text}       {text}       \stopxmlsetups - -% todo: cd:par => \\par -% todo: cd:sep => \\\\ -  \startxmlsetups xml:setups:delimiter -    \doifmode{setups-pass-one} { +    \ifconditional\c_cmd_doing_line          \kern.5\emwidth          \letterbackslash\xmlatt{#1}{name} -    } +    \fi      \ignorespaces  \stopxmlsetups -\unexpanded\def\showSETUPcomponent#1#2#3% -  {\doifelsemode{setups-pass-one} -     {\getvalue{showSETUP#2}{#1}}  % top line -     {\simpleSETUPargument{#3}}}   % column +\startxmlsetups xml:setups:content     \showSETUPcomponent{#1}{content}    \stopxmlsetups +\startxmlsetups xml:setups:displaymath \showSETUPcomponent{#1}{displaymath}\stopxmlsetups +\startxmlsetups xml:setups:index       \showSETUPcomponent{#1}{index}      \stopxmlsetups +\startxmlsetups xml:setups:math        \showSETUPcomponent{#1}{math}       \stopxmlsetups +\startxmlsetups xml:setups:nothing     \showSETUPcomponent{#1}{nothing}    \stopxmlsetups +\startxmlsetups xml:setups:file        \showSETUPcomponent{#1}{file}       \stopxmlsetups +\startxmlsetups xml:setups:position    \showSETUPcomponent{#1}{position}   \stopxmlsetups +\startxmlsetups xml:setups:reference   \showSETUPcomponent{#1}{reference}  \stopxmlsetups +\startxmlsetups xml:setups:csname      \showSETUPcomponent{#1}{csname}     \stopxmlsetups +\startxmlsetups xml:setups:destination \showSETUPcomponent{#1}{destination}\stopxmlsetups +\startxmlsetups xml:setups:triplet     \showSETUPcomponent{#1}{triplet}    \stopxmlsetups +\startxmlsetups xml:setups:word        \showSETUPcomponent{#1}{word}       \stopxmlsetups +\startxmlsetups xml:setups:template    \showSETUPcomponent{#1}{template}   \stopxmlsetups +\startxmlsetups xml:setups:angles      \showSETUPcomponent{#1}{angles}     \stopxmlsetups +\startxmlsetups xml:setups:apply       \showSETUPcomponent{#1}{apply}      \stopxmlsetups +\startxmlsetups xml:setups:twowords    \showSETUPcomponent{#1}{twowords}   \stopxmlsetups +\startxmlsetups xml:setups:threewords  \showSETUPcomponent{#1}{threewords} \stopxmlsetups +\startxmlsetups xml:setups:text        \showSETUPcomponent{#1}{text}       \stopxmlsetups + +% todo: cd:par => \par +% todo: cd:sep => \\ + +\unexpanded\def\showSETUPcomponent#1#2% +  {\ifconditional\c_cmd_doing_line +     \getvalue{showSETUP#2}{#1}% +   \else +     \simpleSETUPargument{#2}% +   \fi}  %D This is the second pass; here we generate the table. @@ -578,7 +569,7 @@  \unexpanded\def\startsecondSETUPcolumn#1#2%    {\bgroup     \scratchdimen2.5\emwidth -   \advance\hangindent\dimexpr\currentSETUPwidth+\scratchdimen\relax +   \advance\hangindent\dimexpr\d_cmd_current_width+\scratchdimen\relax     \noindent \hbox to \hangindent{#1\hss\hbox to \scratchdimen{\hss#2\hss}}}  \unexpanded\def\stopsecondSETUPcolumn @@ -588,69 +579,73 @@  \unexpanded\def\secondSETUPcolumn#1#2%    {\startsecondSETUPcolumn{#1}{#2}\stopsecondSETUPcolumn} -\def\previousSETUPargument{\currentSETUPargument} -  \startxmlsetups xml:setups:assignments -    \doifelsemode{setups-pass-one} { -        \showSETUPassignment{#1} -    } { -        \xdef\currentSETUPwidth{0pt}% +    \ifconditional\c_cmd_doing_line +        \ifcase\c_cmd_kind +            \expandafter\showSETUPline +        \else +            \expandafter\showSETUP +        \fi{#1}{assignment\xmlattdef{#1}{delimiters}{brackets}} +    \else +        \global\d_cmd_current_width\zeropoint          \setbox\scratchbox\vbox\bgroup -            \setmode{setups-measure} +            \settrue\c_cmd_measuring              \xmlall{#1}{/(parameter|resolve)}          \egroup -        \xdef\currentSETUPwidth{\themaxboxwidth\scratchbox}% +        \global\d_cmd_current_width\themaxboxwidth\scratchbox\relax          \startfirstSETUPcolumn{\showSETUPnumber}%              \ignorespaces -            \xmldoifelse {#1} {/(parameter|inherit)} { -                \xmlflush{#1} +            \xmldoifelse {#1} {/(parameter|inherit|resolve)} { +               \xmlflush{#1}              } { -             ... +               \unknown              } -            \let\previousSETUPargument\currentSETUPargument          \stopfirstSETUPcolumn          \blank[\v!halfline]          \ignorespaces -    } +    \fi  \stopxmlsetups  \startxmlsetups xml:setups:keywords -    \doifelsemode{setups-pass-one} { -        \showSETUPkeyword{#1} -    } { +    \ifconditional\c_cmd_doing_line +        \ifcase\c_cmd_kind +            \expandafter\showSETUPline +        \else +            \expandafter\showSETUP +        \fi{#1}{\xmlattdef{#1}{delimiters}{brackets}} +    \else          \startfirstSETUPcolumn{\showSETUPnumber}%              \ignorespaces              \xmlflush{#1} -            \let\previousSETUPargument\currentSETUPargument          \stopfirstSETUPcolumn          \blank[\v!halfline]          \ignorespaces -    } +    \fi  \stopxmlsetups  \startxmlsetups xml:setups:parameter -    \doifmodeelse {setups-measure} { -        \getsetupstring{\xmlatt{#1}{name}}\par -    } { -        \startsecondSETUPcolumn{\getsetupstring{\xmlatt{#1}{name}}}{=} +    \ifconditional\c_cmd_measuring +      \getsetupstring{\xmlatt{#1}{name}}\par +    \else +      \startsecondSETUPcolumn{\getsetupstring{\xmlatt{#1}{name}}}{=}              \ignorespaces              \xmlflush{#1}              \doifmode{interface:setup:defaults} { -                \ifx\currentSETUPhash\empty \else +                \ifx\m_cmd_current_hash\empty \else                      \begingroup                          % todo, make a one level expansion of parameter                          \let\emwidth \relax                          \let\exheight\relax -                        \edef\currentSETUPvalue{\csname named\currentSETUPhash parameter\endcsname\empty{\xmlatt{#1}{name}}} -                        \ifx\currentSETUPvalue\empty \else +                        \edef\temp{\csname named\m_cmd_current_hash parameter\endcsname\empty{\xmlatt{#1}{name}}} +                        \ifx\temp\empty \else                              =\space -                            \detokenize\expandafter{\currentSETUPvalue} +                            \detokenize\expandafter{\temp}                          \fi                      \endgroup                  \fi              }          \stopsecondSETUPcolumn -    } +    \fi      \ignorespaces  \stopxmlsetups @@ -712,16 +707,16 @@  \unexpanded\def\showSETUP#1#2%    {\bgroup -   \doglobal\increment\currentSETUPargument +   \global\advance\c_cmd_current_argument\plusone     \setbox0=\hbox       {\doifelse{\xmlatt{#1}{list}}{yes} -        {\getsetupstring{s:#2}}% -        {\getsetupstring{l:#2}}}% +        {\getsetupstring{cd:#2-l}}% +        {\getsetupstring{cd:#2-s}}}%     \setbox2=\hbox to \wd0       {\hss        \raise1.25\exheight\hbox -        {\txx\ifcase\maximumSETUPargument\relax -           \or*\else\currentSETUPargument +        {\txx\ifcase\c_cmd_maximum_argument \relax +           \or*\else\the\c_cmd_current_argument           \fi}%        \hss}%     \setbox4=\hbox to \wd0 @@ -746,24 +741,17 @@  \unexpanded\def\showSETUPline#1#2%    {\kern.5\emwidth -   \getsetupstring{s:#2}% +   \getsetupstring{cd:#2-s}%     \ignorespaces}  \unexpanded\def\showSETUPnumber -  {\doglobal\increment\currentSETUPargument +  {\global\advance\c_cmd_current_argument\plusone     \hbox to 2\emwidth -     {\ifcase\maximumSETUPargument\relax -        \or*\else\currentSETUPargument +     {\ifcase\c_cmd_maximum_argument \relax +        \or*\else\the\c_cmd_current_argument        \fi        \hss}} -% assignments - -\xmlmapvalue {setups:assignment} {braces}      {\showSETUPassignmentbraces} -\xmlmapvalue {setups:assignment} {brackets}    {\showSETUPassignmentbrackets} -\xmlmapvalue {setups:keyword}    {parentheses} {\showSETUPkeywordparentheses} -\xmlmapvalue {setups:keyword}    {none}        {\showSETUPkeywordnone} -  % todo: replace = by lower  \unexpanded\def\setupEQsymbol % we raise the number already @@ -772,78 +760,6 @@  \unexpanded\def\setupAPPLYsymbol % we raise the number already    {..\lower.25\exheight\hpack{=>}..} -\starttexdefinition unexpanded showSETUPassignmentbraces #1 -    \ifcase\kindofsetup -        \showSETUPline{#1}{bracedassignment} -    \else -        \showSETUP    {#1}{bracedassignment} -    \fi -\stoptexdefinition - -\starttexdefinition unexpanded showSETUPassignmentbrackets #1 -    \ifcase\kindofsetup -        \showSETUPline{#1}{bracketedassignment} -    \else -        \showSETUP    {#1}{bracketedassignment} -    \fi -\stoptexdefinition - -\starttexdefinition unexpanded showSETUPkeywordparentheses #1 -    \ifcase\kindofsetup -        \showSETUPline{#1}{parenthesizedassignment} -    \else -        \showSETUP    {#1}{parenthesizedassignment} -    \fi -\stoptexdefinition - -\starttexdefinition unexpanded showSETUPkeywordnone #1 -    \ifcase\kindofsetup -        \showSETUPline{#1}{none} -    \else -        \showSETUP    {#1}{none} -    \fi -\stoptexdefinition - -\starttexdefinition unexpanded showSETUPassignment #1 -    \xmlvalue -        {setups:assignment} -        {\xmlattdef{#1}{delimiters}{brackets}} -        {\showSETUPkeywordbrackets} -        {#1} -\stoptexdefinition - -% we could also add specifying separatos (default comma) but let's do -% this stepwise - -% keywords - -\xmlmapvalue {setups:keyword} {braces}   {\showSETUPkeywordbraces} -\xmlmapvalue {setups:keyword} {brackets} {\showSETUPkeywordbrackets} - -\starttexdefinition unexpanded showSETUPkeywordbraces #1 -    \ifcase\kindofsetup -        \showSETUPline{#1}{braces} -    \else -        \showSETUP    {#1}{braces} -    \fi -\stoptexdefinition - -\starttexdefinition unexpanded showSETUPkeywordbrackets #1 -    \ifcase\kindofsetup -        \showSETUPline{#1}{brackets} -    \else -        \showSETUP    {#1}{brackets} -    \fi -\stoptexdefinition - -\starttexdefinition unexpanded showSETUPkeyword #1 -    \xmlvalue -        {setups:keyword} -        {\xmlattdef{#1}{delimiters}{brackets}} -        {\showSETUPkeywordbrackets} -        {#1} -\stoptexdefinition -  % arguments  \unexpanded\def\showSETUPdisplaymath#1{\showSETUP    {#1}{displaymath}} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b76b15cd6..24729032d 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  : 04/13/16 16:46:44 +-- merge date  : 04/16/16 15:27:56  do -- begin closure to overcome local limits and interference @@ -6673,6 +6673,92 @@ function mappings.addtounicode(data,filename,checklookups)    if type(checklookups)=="function" then      checklookups(data,missing,nofmissing)    end +  local unset={} +  for unic,glyph in next,descriptions do +    if not glyph.unicode and glyph.class=="ligature" then +      unset[unic]=glyph +    end +  end +  if next(unset) then +    local sequences=resources.sequences +    local collected={} +    for i=1,#sequences do +      local sequence=sequences[i] +      if sequence.type=="gsub_ligature" then +        local steps=sequence.steps +        if steps then +          local l={} +          local function traverse(p,k,v) +            if k=="ligature" then +              collected[v]={ unpack(l) } +            else +              table.insert(l,k) +              for k,vv in next,v do +                traverse(p,k,vv) +              end +              table.remove(l) +            end +          end +          for i=1,#steps do +            local coverage=steps[i].coverage +            if coverage then +              for k,v in next,coverage do +                traverse(k,k,v) +              end +            end +          end +        end +      end +    end +    if next(collected) then +      while true do +        local done=false +        for k,v in next,collected do +          for i=1,#v do +            local vi=v[i] +            if vi==k then +              collected[k]=nil +              unset[k]=nil +            else +              local c=collected[vi] +              if c then +                done=true +                local t={} +                local n=i-1 +                for j=1,n do +                  t[j]=t[j] +                end +                for j=1,#c do +                  n=n+1 +                  t[n]=c[j] +                end +                for j=i+1,#v do +                  n=n+1 +                  t[n]=t[j] +                end +                collected[k]=t +                break +              end +            end +          end +        end +        if not done then +          break +        end +      end +      local n=0 +      for k,v in next,unset do +        u=collected[k] +        if u then +          v.unicode=u +          n=n+1 +        end +      end +      if trace_mapping and n>0 then +        report_fonts("%n ligature tounicode mappings deduced from gsub ligature feaures",n) +      end +    end +  end    if trace_mapping then      for unic,glyph in table.sortedhash(descriptions) do        local name=glyph.name @@ -12506,7 +12592,7 @@ local function handlemark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyp          local b=basecoverage[i]          if components then            for c=1,#components do -            local classes=components[i] +            local classes=components[c]              if classes then                for i=1,nofclasses do                  local anchor=readanchor(f,classes[i]) @@ -15378,7 +15464,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_de  local report_otf=logs.reporter("fonts","otf loading")  local fonts=fonts  local otf=fonts.handlers.otf -otf.version=3.016  +otf.version=3.017   otf.cache=containers.define("fonts","otl",otf.version,true)  local otfreaders=otf.readers  local hashes=fonts.hashes @@ -20017,7 +20103,6 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)                    end                    break                  end -                current=getnext(current)                elseif char==false then                  if discfound then                    notmatchreplace[discfound]=true  | 
