summaryrefslogtreecommitdiff
path: root/tex/context/base/mlib-pps.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mlib-pps.mkiv')
-rw-r--r--tex/context/base/mlib-pps.mkiv33
1 files changed, 21 insertions, 12 deletions
diff --git a/tex/context/base/mlib-pps.mkiv b/tex/context/base/mlib-pps.mkiv
index 950d1be57..4a6b89909 100644
--- a/tex/context/base/mlib-pps.mkiv
+++ b/tex/context/base/mlib-pps.mkiv
@@ -31,20 +31,30 @@
% of interference with the page builder.
\newbox \MPtextbox
-\newtoks\everyMPLIBsettext
+\newtoks\everyMPLIBsettext % not used
-\def\MPLIBfigure#1#2%
- {\setbox\scratchbox\hbox{\externalfigure[#1][\c!mask=#2]}%
- \ctxlua{metapost.edefsxsy(\number\wd\scratchbox,\number\ht\scratchbox,0)}%
- \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[\c!sx=\sx,\c!sy=\sy]{\box\scratchbox}\hss}}}
+\newconditional\MPLIBtextgetdone
+
+% \def\MPLIBsettext#1% #2%
+% {\dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox}
\def\MPLIBsettext#1% #2%
- {\dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox}
+ {\ifconditional\MPLIBtextgetdone
+ \else
+ \cldcontext{metapost.tex.get()}% MPenvironments are depricated
+ \settrue\MPLIBtextgetdone % no \global needed
+ \fi
+ \dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox}
\def\MPLIBgettextscaled#1#2#3% why a copy .. can be used more often
{\ctxlua{metapost.gettext(\number\MPtextbox,#1)}%
\vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[\c!sx=#2,\c!sy=#3]{\raise\dp\MPtextbox\box\MPtextbox}\forcecolorhack\hss}}}
+\def\MPLIBfigure#1#2%
+ {\setbox\scratchbox\hbox{\externalfigure[#1][\c!mask=#2]}%
+ \ctxlua{metapost.edefsxsy(\number\wd\scratchbox,\number\ht\scratchbox,0)}%
+ \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[\c!sx=\sx,\c!sy=\sy]{\box\scratchbox}\hss}}}
+
% horrible:
\def\MPLIBgettextscaledcm#1#2#3#4#5#6#7#8#9% 2-7: sx,rx,ry,sy,tx,ty
@@ -103,16 +113,15 @@
\def\MPLIBextrapass#1%
{\ctxlua{metapost.graphic_extra_pass("#1")}}
+% \def\MPLIBresettexts
+% {\ctxlua{metapost.resettextexts()}}
+
\def\MPLIBresettexts
- {\ctxlua{metapost.resettextexts()}}
+ {\ctxlua{metapost.resettextexts()}%$
+ \setfalse\MPLIBtextgetdone}
%D Experiment
-\let\MPLIBstartgroup\gobblefivearguments
-\let\MPLIBstopgroup \relax
-
-%D Also experimental:
-
\def\doMPLIBstopgroup#1#2#3#4#5#6% some day this might happen elsewhere
{\egroup
\wd\scratchbox \dimexpr#5\onebasepoint-#3\onebasepoint\relax