summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-05-19 18:48:15 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-05-19 18:48:15 +0200
commitf1772caf425af2fe9be87b788eae63559682d51a (patch)
treece9a813989227bea7191db7a8f8bc87ad6d578dd /tex/context/base/mkiv
parent330909ad62342ff873dc758b909968c66d0252a4 (diff)
downloadcontext-f1772caf425af2fe9be87b788eae63559682d51a.tar.gz
2021-05-19 18:21:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-mis.lua2
-rw-r--r--tex/context/base/mkiv/font-ocl.lua3
-rw-r--r--tex/context/base/mkiv/font-ocm.lua3
-rw-r--r--tex/context/base/mkiv/font-otl.lua2
-rw-r--r--tex/context/base/mkiv/font-oup.lua93
-rw-r--r--tex/context/base/mkiv/font-shp.lua2
-rw-r--r--tex/context/base/mkiv/luat-cnf.lua37
-rw-r--r--tex/context/base/mkiv/node-pro.lua2
-rw-r--r--tex/context/base/mkiv/node-syn.lua3
-rw-r--r--tex/context/base/mkiv/scrp-cjk.lua6
-rw-r--r--tex/context/base/mkiv/scrp-ini.lua29
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23942 -> 23943 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin228905 -> 229268 bytes
-rw-r--r--tex/context/base/mkiv/trac-set.lua2
16 files changed, 113 insertions, 75 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 26567e338..b39d55d2c 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{2021.05.15 22:41}
+\newcontextversion{2021.05.19 18:18}
%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 57c7c2001..a3e77c4cd 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{2021.05.15 22:41}
+\edef\contextversion{2021.05.19 18:18}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua
index 8404c04f6..29d4d91c8 100644
--- a/tex/context/base/mkiv/font-mis.lua
+++ b/tex/context/base/mkiv/font-mis.lua
@@ -21,7 +21,7 @@ local readers = otf.readers
if readers then
- otf.version = otf.version or 3.114
+ otf.version = otf.version or 3.115
otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true)
function fonts.helpers.getfeatures(name,save)
diff --git a/tex/context/base/mkiv/font-ocl.lua b/tex/context/base/mkiv/font-ocl.lua
index 9e1f49433..7d960922f 100644
--- a/tex/context/base/mkiv/font-ocl.lua
+++ b/tex/context/base/mkiv/font-ocl.lua
@@ -444,6 +444,7 @@ end
-- local indices = fonts.getindices(tfmdata)
local descriptions = tfmdata.descriptions
local nofshapes = #svgshapes
+ local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
@@ -460,7 +461,7 @@ end
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then
diff --git a/tex/context/base/mkiv/font-ocm.lua b/tex/context/base/mkiv/font-ocm.lua
index bb1550ac9..ef0b02a14 100644
--- a/tex/context/base/mkiv/font-ocm.lua
+++ b/tex/context/base/mkiv/font-ocm.lua
@@ -580,6 +580,7 @@ local initializesvg do
-- local indices = fonts.getindices(tfmdata)
local descriptions = tfmdata.descriptions
local nofshapes = #svgshapes
+ local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
@@ -596,7 +597,7 @@ local initializesvg do
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index 51111fa71..c13011f95 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/font-otl.lua
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.114 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.115 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pngcache = containers.define("fonts", "png", otf.version, true)
diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua
index 2c49bc993..93a1d526e 100644
--- a/tex/context/base/mkiv/font-oup.lua
+++ b/tex/context/base/mkiv/font-oup.lua
@@ -2564,6 +2564,34 @@ end
-- Because we pack we cannot mix tables and numbers so we can only turn a whole set in
-- format kern instead of pair.
+local strip_pairs = true
+
+local compact_pairs = true
+local compact_singles = true
+
+local merge_pairs = true
+local merge_singles = true
+local merge_substitutions = true
+local merge_alternates = true
+local merge_multiples = true
+local merge_ligatures = true
+local merge_cursives = true
+local merge_marks = true
+
+directives.register("otf.strip.pairs", function(v) strip_pairs = v end)
+
+directives.register("otf.compact.pairs", function(v) compact_pairs = v end)
+directives.register("otf.compact.singles", function(v) compact_singles = v end)
+
+directives.register("otf.merge.pairs", function(v) merge_pairs = v end)
+directives.register("otf.merge.singles", function(v) merge_singles = v end)
+directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end)
+directives.register("otf.merge.alternates", function(v) merge_alternates = v end)
+directives.register("otf.merge.multiples", function(v) merge_multiples = v end)
+directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end)
+directives.register("otf.merge.cursives", function(v) merge_cursives = v end)
+directives.register("otf.merge.marks", function(v) merge_marks = v end)
+
local function checkpairs(lookup)
local steps = lookup.steps
local nofsteps = lookup.nofsteps
@@ -2580,7 +2608,8 @@ local function checkpairs(lookup)
local v = d2[1]
if v == true then
-- all zero
- elseif v and (v[1] ~= 0 or v[2] ~= 0 or v[4] ~= 0) then
+ -- elseif v and (v[1] ~= 0 or v[2] ~= 0 or v[4] ~= 0) then
+ elseif v and (v[1] ~= 0 or v[2] ~= 0 or v[3] ~= 0 or v[4] ~= 0) then -- vkrn has v[3] ~= 0
return false
end
end
@@ -2617,29 +2646,39 @@ local function checkpairs(lookup)
return kerned
end
-local compact_pairs = true
-local compact_singles = true
-
-local merge_pairs = true
-local merge_singles = true
-local merge_substitutions = true
-local merge_alternates = true
-local merge_multiples = true
-local merge_ligatures = true
-local merge_cursives = true
-local merge_marks = true
-
-directives.register("otf.compact.pairs", function(v) compact_pairs = v end)
-directives.register("otf.compact.singles", function(v) compact_singles = v end)
+local function strippairs(lookup)
+ local steps = lookup.steps
+ local nofsteps = lookup.nofsteps
+ local stripped = 0
-directives.register("otf.merge.pairs", function(v) merge_pairs = v end)
-directives.register("otf.merge.singles", function(v) merge_singles = v end)
-directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end)
-directives.register("otf.merge.alternates", function(v) merge_alternates = v end)
-directives.register("otf.merge.multiples", function(v) merge_multiples = v end)
-directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end)
-directives.register("otf.merge.cursives", function(v) merge_cursives = v end)
-directives.register("otf.merge.marks", function(v) merge_marks = v end)
+ for i=1,nofsteps do
+ local step = steps[i]
+ if step.format == "pair" then
+ local coverage = step.coverage
+ for g1, d1 in next, coverage do
+ for g2, d2 in next, d1 do
+ if d2[2] then
+ --- true or { a, b, c, d }
+ -- else
+ -- local v = d2[1]
+ -- if v == true then
+ -- d1[g2] = nil
+ -- stripped = stripped + 1
+ -- elseif v and (v[1] == 0 and v[2] == 0 and v[4] == 0) then -- vkrn can have v[3] ~= 0
+ -- d1[g2] = nil
+ -- stripped = stripped + 1
+ -- end
+ -- end
+ elseif d2[1] == true then
+ d1[g2] = nil
+ stripped = stripped + 1
+ end
+ end
+ end
+ end
+ end
+ return stripped
+end
function readers.compact(data)
if not data or data.compacted then
@@ -2648,6 +2687,7 @@ function readers.compact(data)
data.compacted = true
end
local resources = data.resources
+ local stripped = 0
local merged = 0
local kerned = 0
local allsteps = 0
@@ -2678,6 +2718,7 @@ function readers.compact(data)
merged = merged + mergesteps_4(lookup)
end
elseif kind == "gpos_single" then
+ -- maybe also strip zeros here
if merge_singles then
merged = merged + mergesteps_1(lookup,true)
end
@@ -2685,6 +2726,9 @@ function readers.compact(data)
kerned = kerned + checkkerns(lookup)
end
elseif kind == "gpos_pair" then
+ if strip_pairs then
+ stripped = stripped + strippairs(lookup) -- noto cjk from 24M -> 8 M
+ end
if merge_pairs then
merged = merged + mergesteps_2(lookup)
end
@@ -2726,6 +2770,9 @@ function readers.compact(data)
compact("sequences")
compact("sublookups")
if trace_optimizations then
+ if stripped > 0 then
+ report_optimizations("%i zero positions stripped before merging",stripped)
+ end
if merged > 0 then
report_optimizations("%i steps of %i removed due to merging",merged,allsteps)
end
diff --git a/tex/context/base/mkiv/font-shp.lua b/tex/context/base/mkiv/font-shp.lua
index 78e8597b9..ecf0c9418 100644
--- a/tex/context/base/mkiv/font-shp.lua
+++ b/tex/context/base/mkiv/font-shp.lua
@@ -17,7 +17,7 @@ local pfb = fonts.handlers.pfb
local hashes = fonts.hashes
local identifiers = hashes.identifiers
-local version = 0.009
+local version = 0.010
local shapescache = containers.define("fonts", "shapes", version, true)
local streamscache = containers.define("fonts", "streams", version, true)
diff --git a/tex/context/base/mkiv/luat-cnf.lua b/tex/context/base/mkiv/luat-cnf.lua
index f61ec43d2..f0b18675c 100644
--- a/tex/context/base/mkiv/luat-cnf.lua
+++ b/tex/context/base/mkiv/luat-cnf.lua
@@ -27,21 +27,6 @@ texconfig.max_strings = 500000
texconfig.hash_extra = 250000
texconfig.function_size = 32768
texconfig.properties_size = 10000
-
-if CONTEXTLMTXMODE > 0 then
-
-texconfig.max_in_open = 2000
-texconfig.nest_size = 10000
-texconfig.param_size = 100000
-texconfig.save_size = 500000
-texconfig.stack_size = 100000
-texconfig.buffer_size = 10000000
-texconfig.token_size = 10000000
-texconfig.node_size = 50000000
-texconfig.max_pool = 10000000
-
-else
-
texconfig.max_in_open = 1000
texconfig.nest_size = 1000
texconfig.param_size = 25000
@@ -50,27 +35,7 @@ texconfig.stack_size = 10000
texconfig.buf_size = 10000000
texconfig.fix_mem_init = 1000000
-end
-
-local variablenames = CONTEXTLMTXMODE > 0 and {
- error_line = false,
- half_error_line = false,
- max_print_line = false,
- max_in_open = false,
- expand_depth = true,
- hash_extra = true,
- nest_size = true,
- max_strings = true,
- max_pool = true,
- param_size = true,
- save_size = true,
- stack_size = true,
- function_size = true,
- properties_size = true,
- token_size = true,
- node_size = true,
- buffer_size = true,
-} or {
+local variablenames = {
error_line = false,
half_error_line = false,
max_print_line = false,
diff --git a/tex/context/base/mkiv/node-pro.lua b/tex/context/base/mkiv/node-pro.lua
index 6613555f8..8c8356e04 100644
--- a/tex/context/base/mkiv/node-pro.lua
+++ b/tex/context/base/mkiv/node-pro.lua
@@ -65,8 +65,6 @@ do
end
-processors.enabled = true -- this will become a proper state (like trackers)
-
do
local hasglyph = nodes.hasglyph
diff --git a/tex/context/base/mkiv/node-syn.lua b/tex/context/base/mkiv/node-syn.lua
index d2eec6714..8b8b628dd 100644
--- a/tex/context/base/mkiv/node-syn.lua
+++ b/tex/context/base/mkiv/node-syn.lua
@@ -125,7 +125,7 @@ if not modules then modules = { } end modules ['node-syn'] = {
local type, rawset = type, rawset
local concat = table.concat
local formatters = string.formatters
-local replacesuffix, suffixonly, nameonly = file.replacesuffix, file.suffix, file.nameonly
+local replacesuffix, suffixonly, nameonly, collapsepath = file.replacesuffix, file.suffix, file.nameonly, file.collapsepath
local openfile, renamefile, removefile = io.open, os.rename, os.remove
local report_system = logs.reporter("system")
@@ -232,6 +232,7 @@ local blockedsuffixes = {
}
local sttags = table.setmetatableindex(function(t,name)
+ name = collapsepath(name)
if blockedsuffixes[suffixonly(name)] then
-- Just so that I don't get the ones on my development tree.
nofblocked = nofblocked + 1
diff --git a/tex/context/base/mkiv/scrp-cjk.lua b/tex/context/base/mkiv/scrp-cjk.lua
index 541ea9f81..d28b7f922 100644
--- a/tex/context/base/mkiv/scrp-cjk.lua
+++ b/tex/context/base/mkiv/scrp-cjk.lua
@@ -19,8 +19,6 @@ if not modules then modules = { } end modules ['scrp-cjk'] = {
local nuts = nodes.nuts
-local insertnodeafter = nuts.insertafter
-local insertnodebefore = nuts.insertbefore
local copy_node = nuts.copy
local remove_node = nuts.remove
local nextglyph = nuts.traversers.glyph
@@ -70,6 +68,10 @@ local report_details = logs.reporter("scripts","detail")
-- the intercharacter spacing interferes with this; the solution is to patch the
-- nodelist but better is to use veryraggedleft
+local insertnodeafter = scripts.helpers.insertnodeafter
+local insertnodebefore = scripts.helpers.insertnodebefore
+
+
local inter_char_shrink = 0
local inter_char_stretch = 0
local inter_char_half_shrink = 0
diff --git a/tex/context/base/mkiv/scrp-ini.lua b/tex/context/base/mkiv/scrp-ini.lua
index 0fafd9854..857d2ac6e 100644
--- a/tex/context/base/mkiv/scrp-ini.lua
+++ b/tex/context/base/mkiv/scrp-ini.lua
@@ -57,9 +57,6 @@ local setglyphdata = nuts.setglyphdata
local isglyph = nuts.isglyph
-local insertnodeafter = nuts.insertafter
-local insertnodebefore = nuts.insertbefore
-
local firstglyph = nuts.firstglyph
local nextglyph = nuts.traversers.glyph
@@ -86,6 +83,9 @@ scripts.injectors = handlers
local splitters = allocate()
scripts.splitters = splitters
+local helpers = allocate()
+scripts.helpers = helpers
+
-- we need to fake it in luatex
local getscript = node.direct.getscript
@@ -116,6 +116,29 @@ if not getscript then
end
+local insertnodebefore, insertnodeafter do
+
+ local insertafter = nuts.insertnodeafter
+ local insertbefore = nuts.insertnodebefore
+ local setattributelist = nuts.setattributelist
+
+ local function insertnodebefore(head,current,what) -- todo : lmtx
+ head, current = insertbefore(head,current,what)
+ setattributelist(what,current)
+ return head, current
+ end
+
+ local function insertnodeafter(head,current,what) -- todo : lmtx
+ head, current = insertafter(head,current,what)
+ setattributelist(what,current)
+ return head, current
+ end
+
+ helpers.insertnodebefore = insertnodebefore
+ helpers.insertnodeafter = insertnodeafter
+
+end
+
local hash = { -- we could put these presets in char-def.lua
--
-- half width opening parenthesis
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 461037595..59d7fb57e 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index cd95f9e07..1cb90cb26 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/trac-set.lua b/tex/context/base/mkiv/trac-set.lua
index 4edb5d129..0441f386b 100644
--- a/tex/context/base/mkiv/trac-set.lua
+++ b/tex/context/base/mkiv/trac-set.lua
@@ -409,7 +409,7 @@ if texconfig then
-- this happens too late in ini mode but that is no problem
local function set(k,v)
- v = tonumber(v)
+ local v = tonumber(v)
if v then
texconfig[k] = v
end