diff options
author | Hans Hagen <pragma@wxs.nl> | 2011-01-14 14:32:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2011-01-14 14:32:00 +0100 |
commit | 237091b7a4e3a7e2e6601cfe246dac4b4b1ff988 (patch) | |
tree | c4135682b1fd54c266d318ed406ef4bc9e0d629f /tex/context/base/meta-pdf.lua | |
parent | 8980a62e6a345d2f2746bdca2d207d6cf78aab5f (diff) | |
download | context-237091b7a4e3a7e2e6601cfe246dac4b4b1ff988.tar.gz |
beta 2011.01.14 14:32
Diffstat (limited to 'tex/context/base/meta-pdf.lua')
-rw-r--r-- | tex/context/base/meta-pdf.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tex/context/base/meta-pdf.lua b/tex/context/base/meta-pdf.lua index ad4bcca81..929c2047e 100644 --- a/tex/context/base/meta-pdf.lua +++ b/tex/context/base/meta-pdf.lua @@ -24,7 +24,7 @@ local pdfgraycode = lpdf.graycode local pdfspotcode = lpdf.spotcode local pdftransparencycode = lpdf.transparencycode local pdffinishtransparencycode = lpdf.finishtransparencycode -local pdfliteral = node.pdfliteral +local pdfliteral = nodes.pool.pdfliteral metapost.mptopdf = metapost.mptopdf or { } local mptopdf = metapost.mptopdf @@ -50,12 +50,14 @@ end resetall() --- todo: collect and flush packed using pdfliteral node injection but we're --- in no hurry as this kind of conversion does not happen that often in mkiv +-- -- this does not work as expected (displacement of text) +-- -- beware, needs another comment hack +-- +-- local function pdfcode(str) +-- context(pdfliteral(str)) +-- end -local function pdfcode(str) -- could be a node.write instead - context(pdfliteral(str)) -end +local pdfcode = context.pdfliteral local function mpscode(str) if ignore_path then @@ -510,7 +512,6 @@ local verbose = ( -- order matters in terms of speed / we could check for procset first local captures_old = ( space + verbose + preamble )^0 ---~ local captures_new = ( space + procset + preamble + verbose )^0 local captures_new = ( space + verbose + procset + preamble )^0 local function parse(m_data) @@ -532,11 +533,13 @@ function mptopdf.convertmpstopdf(name) mps.colormodel = tex.attribute[a_colorspace] statistics.starttiming(mptopdf) mptopdf.nofconverted = mptopdf.nofconverted + 1 + -- pdfcode(format("%% mptopdf begin: n=%s, file=%s",mptopdf.nofconverted,file.basename(name))) pdfcode(format("\\letterpercent\\space mptopdf begin: n=%s, file=%s",mptopdf.nofconverted,file.basename(name))) pdfcode("q 1 0 0 1 0 0 cm") parse(m_data) pdfcode(pdffinishtransparencycode()) pdfcode("Q") + -- pdfcode("% mptopdf end") pdfcode("\\letterpercent\\space mptopdf end") resetall() statistics.stoptiming(mptopdf) @@ -545,7 +548,6 @@ function mptopdf.convertmpstopdf(name) end end - -- status info statistics.register("mps conversion time",function() |