diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mlib-pps.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mlib-pps.mkiv | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/context/base/mlib-pps.mkiv b/Master/texmf-dist/tex/context/base/mlib-pps.mkiv index 0a78a87040e..357f85b1a1f 100644 --- a/Master/texmf-dist/tex/context/base/mlib-pps.mkiv +++ b/Master/texmf-dist/tex/context/base/mlib-pps.mkiv @@ -33,38 +33,28 @@ \newbox \MPtextbox \newtoks\everyMPLIBsettext -\def\MPLIBfigure#1#2#3#4#5#6#7% todo: move Q q to lua - {\setbox\scratchbox\hbox{\externalfigure[#7]}% +\def\MPLIBfigure#1#2% + {\setbox\scratchbox\hbox{\externalfigure[#1][\c!mask=#2]}% \ctxlua{metapost.edefsxsy(\number\wd\scratchbox,\number\ht\scratchbox,0)}% - \pdfliteral direct{q #1 #2 #3 #4 #5 #6 cm}% no direct - \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[sx=\sx,sy=\sy]{\box\scratchbox}\hss}}% - \pdfliteral direct{Q}} + \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[\c!sx=\sx,\c!sy=\sy]{\box\scratchbox}\hss}}} \def\MPLIBsettext#1% #2% {\dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox} -\def\MPLIBgettextscaled#1#2#3% why a copy - {\ctxlua{metapost.gettext(\number\MPtextbox,#1)}% - \vbox to \zeropoint{\vss\hbox to \zeropoint{\black\scale[sx=#2,sy=#3]{\raise\dp\MPtextbox\box\MPtextbox}\hss}}} +\def\MPLIBgettextscaled#1#2#3% why a copy .. can be used more often + {\ctxlua{metapost.gettext(\number\MPtextbox,#1)}% we need the colorhack or else the color backend does not sync + \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[\c!sx=#2,\c!sy=#3]{\raise\dp\MPtextbox\box\MPtextbox}\forcecolorhack\hss}}} \def\MPLIBgraphictext#1% {\startTEXpage[\c!scale=10000]#1\stopTEXpage} -\protect \endinput +\def\MPLIBpositionwhd#1#2#3#4#5% + {\dosavepositionwhd{#1}{0}{#2sp}{#3sp}{#4sp}{#5sp}{0sp}} + +\def\MPLIBextrapass#1% + {\ctxlua{metapost.graphic_extra_pass(#1)}} -% \def\MPLIBsettext#1% #2% we could as well store in hlists at the lua end i.e. just one box -% {\global\setbox#1\hbox} -% -% \def\MPLIBfreetext#1% -% {\global\setbox#1\emptybox} -% -% \def\MPLIBgettextscaled#1#2#3% why a copy -% {\vbox to \zeropoint{\vss\hbox to \zeropoint{\black\scale[sx=#2,sy=#3]{\raise\dp#1\copy#1}\hss}}} -% -% \def\MPLIBallocate#1% -% {\newbox\MPLIBfirst -% \dorecurse{\numexpr#1-1\relax}{\let\MPLIBlast\relax\newbox\MPLIBlast}% -% \MPLIBregister} -% -% \def\MPLIBregister % after allocate! -% {\ctxlua{metapost.first_box, metapost.last_box = \number\MPLIBfirst, \number\MPLIBlast}} +\def\MPLIBresettexts + {\ctxlua{metapost.resettextexts()}} + +\protect \endinput |