summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mlib-pdf.mkiv
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-08 00:43:40 +0000
committerKarl Berry <karl@freefriends.org>2013-04-08 00:43:40 +0000
commit824f7b0903de8ad7f6ee3d7656005e4c59155e06 (patch)
treeabfc8673ef9916f3ab7074e811207384c301492b /Master/texmf-dist/tex/context/base/mlib-pdf.mkiv
parent689aefb0727676ed3cddf331337b4be226495e72 (diff)
context import for TL13, from www.pragma-ade.com/context/beta/cont-tmf.zip
git-svn-id: svn://tug.org/texlive/trunk@29731 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mlib-pdf.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-pdf.mkiv45
1 files changed, 27 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/context/base/mlib-pdf.mkiv b/Master/texmf-dist/tex/context/base/mlib-pdf.mkiv
index b9871eeadae..0913b3699ae 100644
--- a/Master/texmf-dist/tex/context/base/mlib-pdf.mkiv
+++ b/Master/texmf-dist/tex/context/base/mlib-pdf.mkiv
@@ -21,15 +21,15 @@
%D Some code is shared between MPLIB and MPS. The following variables
%D are also available for introspection and other purposes.
-\newdimen\MPwidth
-\newdimen\MPheight
+\ifdefined\MPwidth \else \newdimen\MPwidth \fi
+\ifdefined\MPheight \else \newdimen\MPheight \fi
-\newdimen\MPllx
-\newdimen\MPlly
-\newdimen\MPurx
-\newdimen\MPury
+\ifdefined\MPllx \else \newdimen\MPllx \fi
+\ifdefined\MPlly \else \newdimen\MPlly \fi
+\ifdefined\MPurx \else \newdimen\MPurx \fi
+\ifdefined\MPury \else \newdimen\MPury \fi
-\newbox \MPbox
+\ifdefined\MPbox \else \newbox \MPbox \fi
\def\setMPboundingbox#1#2#3#4% at some point we might pass them as base or scaled points
{\global\MPllx #1\onebasepoint
@@ -49,7 +49,7 @@
\def\repositionMPboxindeed
{\setbox\MPbox\hbox\bgroup
- \hskip-\MPllx
+ \kern-\MPllx
\raise-\MPlly
\box\MPbox
\egroup}
@@ -91,7 +91,8 @@
\def\MPLIBtoPDF#1{\ctxlua{metapost.flushliteral(#1)}}
\def\startMPLIBtoPDF#1#2#3#4%
- {\dostarttagged\t!mpgraphic\empty
+ {\meta_process_graphic_figure_start
+ \dostarttagged\t!mpgraphic\empty
\naturalhbox attr \imageattribute 1 \bgroup
\dousecolorparameter\s!black\forcecolorhack
\setMPboundingbox{#1}{#2}{#3}{#4}%
@@ -104,7 +105,8 @@
\finalizeMPbox
\box\MPbox
\egroup
- \dostoptagged}
+ \dostoptagged
+ \meta_process_graphic_figure_stop}
\def\MPLIBflushreset % This can (will) move to the Lua end.
{\ctxlua{metapost.flushreset()}}
@@ -138,14 +140,21 @@
\let\stopMPLIBtoPDF \directstopMPLIBtoPDF
\meta_start_current_graphic
\forgetall
- \normalexpanded{\noexpand\ctxlua{metapost.graphic(
- "\currentMPinstance",
- "\currentMPformat",
- \!!bs#2;\!!es,
- \!!bs\meta_flush_current_initializations;\!!es,
- \!!bs\meta_flush_current_preamble;\!!es,
- "all"
- )}}%
+ \edef\p_extensions{\MPinstanceparameter\s!extensions}%
+ \normalexpanded{\noexpand\ctxlua{metapost.graphic {
+ instance = "\currentMPinstance",
+ format = "\currentMPformat",
+ data = \!!bs#2;\!!es,
+ initializations = \!!bs\meta_flush_current_initializations\!!es,
+% useextensions = "\MPinstanceparameter\s!extensions",
+\ifx\p_extensions\v!yes
+ extensions = \!!bs\ctxcommand{getmpextensions("\currentMPinstance")}\!!es,
+\fi
+ inclusions = \!!bs\meta_flush_current_inclusions\!!es,
+ definitions = \!!bs\meta_flush_current_definitions\!!es,
+ figure = "all",
+ method = "\MPinstanceparameter\c!method",
+ }}}%
\meta_stop_current_graphic
\meta_end_graphic_group}