diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-14 19:58:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-14 19:58:50 +0200 |
commit | fd0c4577a4b6e85ca2db664906e1a03807ce133f (patch) | |
tree | fa23fcc04248d03ff82e34634b8ef1bb9cf28acb /tex/context/base/mkiv/mlib-pps.mkiv | |
parent | db581096187dc2d3cbdbe4cdc39d247c168b1607 (diff) | |
download | context-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz |
2017-05-14 19:15:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-pps.mkiv')
-rw-r--r-- | tex/context/base/mkiv/mlib-pps.mkiv | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/mlib-pps.mkiv b/tex/context/base/mkiv/mlib-pps.mkiv index cdccfc379..a2eb44826 100644 --- a/tex/context/base/mkiv/mlib-pps.mkiv +++ b/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 |