diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv index cdccfc379a9..a2eb4482606 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv @@ -91,6 +91,33 @@ \smashbox\MPbox \box\MPbox} +% \putnextboxincache{hans}{1}\hbox{foo} +% +% \startMPcode +% draw boundingbox rawtexbox("hans",1) ; +% draw rawtexbox("hans",1) ; +% \stopMPcode + +\unexpanded\def\MPLIBgetboxscaledcm#1#2% + {\begingroup + \copyboxfromcache{#1}{#2}\MPtextbox % can be \clf_ + \MPLIBgetboxscaledcm_next} + +\unexpanded\def\MPLIBgetboxscaledcm_next#1#2#3#4#5#6#7#8% 1-6: sx,rx,ry,sy,tx,ty + {\setbox\MPbox\hpack\bgroup + \dotransformnextbox{#1}{#2}{#3}{#4}{#5}{#6}% + \vpack to \zeropoint\bgroup + \vss + \hpack to \zeropoint \bgroup + \fastsxsy{#7}{#8}{\raise\dp\MPtextbox\box\MPtextbox}% + \hss + \egroup + \egroup + \egroup + \smashbox\MPbox + \box\MPbox + \endgroup} + \unexpanded\def\MPLIBgraphictext#1% use at mp end {\startTEXpage[\c!scale=10000]#1\stopTEXpage} @@ -134,12 +161,19 @@ \wd\scratchbox \dimexpr#5\onebasepoint-#3\onebasepoint+2\onebasepoint\relax \ht\scratchbox #6\onebasepoint \dp\scratchbox-#4\onebasepoint + \setbox\scratchbox\hpack\bgroup + \kern-#3\onebasepoint + \box\scratchbox + \egroup \saveboxresource - attr {/Group << /S /Transparency /I \ifnum#1=1 true \else false \fi /K \ifnum#1=1 true \else false \fi >>} + attr {/Group << /S /Transparency /I \ifnum#1=1 true \else false \fi /K \ifnum#2=1 true \else false \fi >>} resources {\pdfbackendcurrentresources} \scratchbox - % \setbox\scratchbox\hbox\bgroup\kern-\onebasepoint\useboxresource\lastsavedboxresourceindex\egroup % why twice? - \setbox\scratchbox\hpack\bgroup\kern-\onebasepoint\useboxresource\lastsavedboxresourceindex\egroup + \setbox\scratchbox\hpack\bgroup + \kern#3\onebasepoint + \kern-\onebasepoint + \useboxresource\lastsavedboxresourceindex + \egroup \wd\scratchbox\zeropoint \ht\scratchbox\zeropoint \dp\scratchbox\zeropoint |