diff options
Diffstat (limited to 'tex/context/base/mkiv')
-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/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/lpdf-lmt.lmt | 23 | ||||
-rw-r--r-- | tex/context/base/mkiv/mlib-pdf.lua | 6 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-fmt.lua | 177 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-low.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-prm.lua | 1 | ||||
-rw-r--r-- | tex/context/base/mkiv/spac-par.mkiv | 5 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 28102 -> 28138 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 254946 -> 254736 bytes |
11 files changed, 197 insertions, 23 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index a3af1d3aa..a54645989 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{2020.07.20 19:47} +\newcontextversion{2020.07.21 18:36} %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 60743ead8..9ef82e072 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2020.07.20 19:47} +\edef\contextversion{2020.07.21 18:36} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index d479ad178..26825b102 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2020.07.20 19:47} +\edef\contextversion{2020.07.21 18:36} %D Kind of special: diff --git a/tex/context/base/mkiv/lpdf-lmt.lmt b/tex/context/base/mkiv/lpdf-lmt.lmt index ed385b4de..7e992f79e 100644 --- a/tex/context/base/mkiv/lpdf-lmt.lmt +++ b/tex/context/base/mkiv/lpdf-lmt.lmt @@ -148,10 +148,6 @@ local function reset_buffer() b = 0 end -local function flush_buffer() - b = 0 -end - -- fonts local fontcharacters @@ -723,6 +719,8 @@ local flushliteral do updaters.register("backend.update.pdf",function() function pdf.print(mode,str) + -- This only works inside objects, don't change this to flush + -- in between. It's different from luatex but okay. if str then mode = literalvalues[mode] else @@ -748,7 +746,6 @@ local flushliteral do -- pdf_set_pos(pdf_h,pdf_v) end b = b + 1 ; buffer[b] = str - flush_buffer() end end end) @@ -1708,9 +1705,9 @@ local finalize do -- Indirect objects don't work in all viewers. - if TrimBox then pageattributes.TrimBox = TrimBox end -- pdfsharedobject(TrimBox ) - if CropBox then pageattributes.CropBox = CropBox end -- pdfsharedobject(CropBox ) - if BleedBox then pageattributes.BleedBox = BleedBox end -- pdfsharedobject(BleedBox) + if TrimBox then pageattributes.TrimBox = pdfsharedobject(TrimBox ) end + if CropBox then pageattributes.CropBox = pdfsharedobject(CropBox ) end + if BleedBox then pageattributes.BleedBox = pdfsharedobject(BleedBox) end else @@ -2228,6 +2225,7 @@ local openfile, closefile do f = { } flush = function(f,s) n = n + 1 f[n] = s +offset = offset + #s end close = function(f) f = concat(f) @@ -2257,19 +2255,12 @@ local openfile, closefile do close = m.close or m.__index.close end -- - flush_buffer = function() - if b > 0 then - flush(f,concat(buffer,"",1,b)) - b = 0 - end - end - local v = f_pdf(majorversion,minorversion) -- local b = "%\xCC\xD5\xC1\xD4\xC5\xD8\xD0\xC4\xC6\010" -- LUATEXPDF (+128) local b = "%\xC3\xCF\xCE\xD4\xC5\xD8\xD4\xD0\xC4\xC6\010" -- CONTEXTPDF (+128) flush(f,v) flush(f,b) - offset = #v + #b + offset = offset + #v + #b end closefile = function(abort) diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua index 372a77f41..44e78ba91 100644 --- a/tex/context/base/mkiv/mlib-pdf.lua +++ b/tex/context/base/mkiv/mlib-pdf.lua @@ -460,7 +460,7 @@ function metapost.flush(specification,result) result[#result+1] = evenodd and "W* n" or "W n" elseif objecttype == "stop_clip" then result[#result+1] = "Q" - miterlimit, linecap, linejoin, dashed = -1, -1, -1, "" -- was false + miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false elseif objecttype == "start_bounds" or objecttype == "stop_bounds" then -- skip elseif objecttype == "start_group" then @@ -475,7 +475,7 @@ function metapost.flush(specification,result) bbox = toboundingbox(object.path), }) result = { } -miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false + miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false else insert(groupstack,false) end @@ -490,7 +490,7 @@ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false result[#result+1] = reference result = pluginactions(data.after,result,flushfigure) result[#result+1] = "Q" -miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false + miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false end else -- we use an indirect table as we want to overload diff --git a/tex/context/base/mkiv/mult-fmt.lua b/tex/context/base/mkiv/mult-fmt.lua new file mode 100644 index 000000000..a91999afd --- /dev/null +++ b/tex/context/base/mkiv/mult-fmt.lua @@ -0,0 +1,177 @@ +if not modules then modules = { } end modules ['mult-fmt'] = { + version = 1.001, + comment = "companion to mult-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local next = next +local concat, sortedhash = table.concat, table.sortedhash +local sub, formatters = string.sub, string.formatters +local utfsplit = utf.split + +local prtcatcodes = catcodes.numbers.prtcatcodes +local contextsprint = context.sprint +local implement = interfaces.implement + +local report = logs.reporter("interface") +local report_interface = logs.reporter("interface","initialization") +local report_variable = logs.reporter("variable") +local report_constant = logs.reporter("constant") +local report_command = logs.reporter("command") +local report_element = logs.reporter("element") +local report_format = logs.reporter("format") +local report_messagetag = logs.reporter("messagetag") +local report_setupstring = logs.reporter("setupstring") + +local function limit(str,n) + if n > 6 and #str > n then + n = n - 4 + local t = utfsplit(str) + local m = #t + if m > n then + t[n] = " ..." + str = concat(t,"",1,n) + end + end + return str +end + +function interfaces.setuserinterface(interface,response) + local variables = interfaces.variables + local constants = interfaces.constants + local elements = interfaces.elements + local formats = interfaces.formats + local translations = interfaces.translations + local setupstrings = interfaces.setupstrings + local complete = interfaces.complete + local sharedstorage = storage.shared + -- + sharedstorage.currentinterface, currentinterface = interface, interface + sharedstorage.currentresponse, currentresponse = response, response + -- + if environment.initex then + local nofconstants = 0 + local nofvariables = 0 + local nofelements = 0 + local nofcommands = 0 + local nofformats = 0 + local noftranslations = 0 + local nofsetupstrings = 0 + -- + do + local list = complete.constants -- forces the load + local t = { } + local f = formatters["\\ui_c{%s}{%s}"], formatters["\\ui_s{%s}"] + local s = formatters["\\ui_s{%s}"] + logs.startfilelogging(report,"translated constants") + for given, constant in sortedhash(list) 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 + report_constant("%-40s: %s",given,constant) + end + logs.stopfilelogging() + contextsprint(prtcatcodes,concat(t)) + end + do + local list = complete.variables -- forces the load + local t = { } + local f = formatters["\\ui_v{%s}{%s}"] + logs.startfilelogging(report,"translated variables") + for given, variable in sortedhash(list) do + variable = variable[interface] or variable.en or given + variables[given] = variable -- ja -> yes + nofvariables = nofvariables + 1 + t[nofvariables] = f(given,variable) + report_variable("%-40s: %s",given,variable) + end + logs.stopfilelogging() + contextsprint(prtcatcodes,concat(t)) + end + do + local list = complete.elements -- forces the load + local t = { } + local f = formatters["\\ui_e{%s}{%s}"] + logs.startfilelogging(report,"translated elements") + for given, element in sortedhash(list) do + element = element[interface] or element.en or given + elements[element] = given + nofelements = nofelements + 1 + t[nofelements] = f(given,element) + report_element("%-40s: %s",given,element) + end + logs.stopfilelogging() + contextsprint(prtcatcodes,concat(t)) + end + do + local list = complete.commands -- forces the load + local t = { } + local n = 0 + local f = formatters["\\ui_a\\%s\\%s"] -- formatters["\\ui_m{%s}{%s}"] + logs.startfilelogging(report,"translated commands") + for given, command in sortedhash(list) do + command = command[interface] or command.en or given + if command ~= given then + n = n + 1 + t[n] = f(given,command) + report_command("%-40s: %s",given,command) + end + nofcommands = nofcommands + 1 + end + logs.stopfilelogging() + contextsprint(prtcatcodes,"\\toksapp\\everydump{"..concat(t).."}") + end + do + local list = complete.messages.formats + logs.startfilelogging(report,"translated message formats") + for given, format in sortedhash(list) do + local found = format[interface] or format.en or given + formats[given] = found + nofformats = nofformats + 1 + report_messagetag("%-40s: %s",limit(given,38),limit(found,38)) + end + logs.stopfilelogging() + end + do + local list = complete.messages.translations + logs.startfilelogging(report,"translated message tags") + for given, translation in sortedhash(list) do + local found = translation[interface] or translation.en or given + translations[given] = found + noftranslations = noftranslations + 1 + report_messagetag("%-40s: %s",given,found) + end + logs.stopfilelogging() + end + do + local list = complete.setupstrings + logs.startfilelogging(report,"translated setupstrings") + for given, setupstring in sortedhash(list) do + local found = setupstring[interface] or setupstring.en or given + setupstrings[given] = found + nofsetupstrings = nofsetupstrings + 1 + report_setupstring("%-40s: %s",given,found) + end + logs.stopfilelogging() + end + report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations, %a setupstrings", + nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations,nofsetupstrings) + else + report_interface("the language(s) can only be set when making the format") + end + interfaces.currentinterface = currentinterface + interfaces.currentresponse = currentresponse +end + +interfaces.implement { + name = "setuserinterface", + actions = interfaces.setuserinterface, + arguments = "2 strings", +} diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index 6d21e46e9..5a5fac8b5 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -450,7 +450,7 @@ return { "installctxfunction", "installprotectedctxfunction", "installprotectedctxscanner", "installctxscanner", "resetctxscanner", "cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand", -- - "carryoverpar", + "carryoverpar", "freezeparagraphproperties", "lastlinewidth", -- "assumelongusagecs", diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index ddb97aca3..e842c485a 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -400,6 +400,7 @@ return { "scantextokens", "setfontid", "shapemode", + "snapshotpar", "supmarkmode", "textdirection", "thewithoutunit", diff --git a/tex/context/base/mkiv/spac-par.mkiv b/tex/context/base/mkiv/spac-par.mkiv index 1fd1cbd8a..e36fb5483 100644 --- a/tex/context/base/mkiv/spac-par.mkiv +++ b/tex/context/base/mkiv/spac-par.mkiv @@ -49,6 +49,11 @@ \unexpanded\def\flushparagraphproperties {\popmacro\currentparagraphproperties} +%D New experimental stuff: + +\unexpanded\def\freezeparagraphproperties{\snapshotpar\maxdimen} + + %D Beware, changing this will break some code (like pos/backgrounds) but it has been %D changed anyway so let's see where things go wrong. diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 277fd403a..85cfd67cc 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 821e78dbb..8b5617c52 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf |