diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/meta-pdf.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/meta-pdf.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/context/base/meta-pdf.lua b/Master/texmf-dist/tex/context/base/meta-pdf.lua index 13d39e445ea..0287b82658e 100644 --- a/Master/texmf-dist/tex/context/base/meta-pdf.lua +++ b/Master/texmf-dist/tex/context/base/meta-pdf.lua @@ -9,8 +9,12 @@ if not modules then modules = { } end modules ['meta-pdf'] = { -- Finally we used an optimized version. The test code can be found in -- meta-pdh.lua but since we no longer want to overload functione we use -- more locals now. This module keeps changing as it is also a testbed. +-- +-- We can make it even more efficient if needed, but as we don't use this +-- code often in \MKIV\ it makes no sense. -local concat, format, gsub, find, byte, gmatch, match = table.concat, string.format, string.gsub, string.find, string.byte, string.gmatch, string.match +local concat, unpack = table.concat, table.unpack +local format, gsub, find, byte, gmatch, match = string.format, string.gsub, string.find, string.byte, string.gmatch, string.match local lpegmatch = lpeg.match local round = math.round @@ -50,8 +54,8 @@ end resetall() --- -- this does not work as expected (displacement of text) --- -- beware, needs another comment hack +-- -- this does not work as expected (displacement of text) beware, needs another +-- -- comment hack -- -- local function pdfcode(str) -- context(pdfliteral(str)) @@ -76,7 +80,7 @@ end local function flushconcat() if m_stack_concat then - mpscode(concat(m_stack_concat," ") .. " cm") + mpscode("%f %f %f %f %f %f cm",unpack(m_stack_concat)) -- no %s due to 1e-035 issues m_stack_concat = nil end end @@ -192,6 +196,7 @@ end function mps.setdash(...) -- can be made faster, operate on t = { ... } local n = select("#",...) mpscode("[" .. concat({...}," ",1,n-1) .. "] " .. select(n,...) .. " d") + -- mpscode("[" .. concat({select(1,n-1)}," ") .. "] " .. select(n,...) .. " d") end function mps.resetdash() @@ -544,7 +549,7 @@ function mptopdf.convertmpstopdf(name) resetall() statistics.stoptiming(mptopdf) else - report_mptopdf("file '%s' not found",name) + report_mptopdf("file %a not found",name) end end |