diff options
Diffstat (limited to 'tex/context/base/mkxl/supp-box.lmt')
-rw-r--r-- | tex/context/base/mkxl/supp-box.lmt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tex/context/base/mkxl/supp-box.lmt b/tex/context/base/mkxl/supp-box.lmt index 93b97b48e..ae4e32353 100644 --- a/tex/context/base/mkxl/supp-box.lmt +++ b/tex/context/base/mkxl/supp-box.lmt @@ -602,6 +602,20 @@ do setbox(box,b or nil) end + function boxes.prune(category) + -- this one assumes an indexed list + local c = cache[category] + local t = { } + local n = 0 + for i=1,#c do + local ci = c[i] + if ci then + n = n + 1 ; t[n] = ci + end + end + cache[category] = t + end + local function dimensions(category,name) name = tonumber(name) or name local b = cache[category][name] @@ -703,6 +717,14 @@ do } implement { + name = "pruneboxesincache", + public = true, + protected = true, + arguments = "string", + actions = boxes.prune, + } + + implement { name = "disposeboxesincache", public = true, protected = true, @@ -760,6 +782,18 @@ do } implement { + name = "getboxhtdpfromcache", + arguments = "2 strings", + public = true, + protected = true, + usage = "value", + actions = function(category,name) + local w, h, d = dimensions(category,name) + return dimension_value, h + d + end, + } + + implement { name = "putnextboxincache", public = true, protected = true, |