diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua index 89f2fa0eeb1..c913408cd05 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua @@ -80,6 +80,7 @@ implement { } local patterns = { + CONTEXTLMTXMODE > 0 and "meta-imp-%s.mkxl" or "", "meta-imp-%s.mkiv", "meta-imp-%s.tex", -- obsolete: @@ -88,10 +89,8 @@ local patterns = { } local function action(name,foundname) + commands.loadlibrary(name,foundname,false) status_metapost("library %a is loaded",name) - context.startreadingfile() - context.input(foundname) - context.stopreadingfile() end local function failure(name) @@ -245,6 +244,8 @@ implement { arguments = "string", } +-- this has to become a codeinjection + function metapost.getclippath(specification) -- why not a special instance for this local mpx = metapost.pushformat(specification) local data = specification.data or "" @@ -304,7 +305,14 @@ end implement { name = "mpsetclippath", actions = function(specification) - setmacro("MPclippath",metapost.theclippath(specification),"global") + local p = specification.data and metapost.theclippath(specification) + if not p or p == "" then + local b = number.dimenfactors.bp + local w = b * (specification.width or 0) + local h = b * (specification.height or 0) + p = formatters["0 0 m %.6N 0 l %.6N %.6N l 0 %.6N l"](w,w,h,h) + end + setmacro("MPclippath",p,"global") end, arguments = { { @@ -316,12 +324,14 @@ implement { { "inclusions" }, { "method" }, { "namespace" }, + { "width", "dimension" }, + { "height", "dimension" }, }, } } statistics.register("metapost", function() - local n = metapost.n + local n = metapost.nofruns if n and n > 0 then local elapsedtime = statistics.elapsedtime local elapsed = statistics.elapsed |