summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mlib-pps.mkiv
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2009-08-23 11:11:32 +0000
committerTaco Hoekwater <taco@elvenkind.com>2009-08-23 11:11:32 +0000
commit8fc3039c82d48605b5ca8b2eda3f4fdd755681e1 (patch)
tree3cd9bbdd599bc4d1ac0409e167fee2136e4c0ec9 /Master/texmf-dist/tex/context/base/mlib-pps.mkiv
parent850fc99b7cd3ae7a20065531fe866ff7bae642ec (diff)
this is context 2009.08.19 17:10
git-svn-id: svn://tug.org/texlive/trunk@14827 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mlib-pps.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-pps.mkiv47
1 files changed, 47 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mlib-pps.mkiv b/Master/texmf-dist/tex/context/base/mlib-pps.mkiv
new file mode 100644
index 00000000000..83880994b0e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mlib-pps.mkiv
@@ -0,0 +1,47 @@
+%D \module
+%D [ file=mlib-pps,
+%D version=2008.03.25,
+%D title=\METAPOST\ Integrated Graphics,
+%D subtitle=Basics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\registerctxluafile{mlib-pps}{1.001}
+
+% this will move !
+
+\def\MPLIBfigure#1#2#3#4#5#6#7% todo: move Q q to lua
+ {\setbox\scratchbox\hbox{\externalfigure[#7]}%
+ \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}}
+
+\def\MPLIBsettext#1% #2%
+ {\global\setbox#1\hbox}% {#2}}
+
+\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\MPLIBgraphictext#1%
+ {\startTEXpage[\c!scale=10000]#1\stopTEXpage}
+
+\protect \endinput