summaryrefslogtreecommitdiff
path: root/src/fontloader/misc/fontloader-mplib.tex
diff options
context:
space:
mode:
authorDavid Carlisle <d.p.carlisle@gmail.com>2015-11-21 21:45:03 +0000
committerDavid Carlisle <d.p.carlisle@gmail.com>2015-11-21 21:45:03 +0000
commitb46f13e0949e310b46e97e791fd4e9e38635a491 (patch)
tree415c893c82e7f55ed630a10033885f1b5781ab56 /src/fontloader/misc/fontloader-mplib.tex
parenta472b6fd5461318ec1e5d2899af2ef57f0fb14e8 (diff)
parent6c3d70e21b100c6c7ffa11e1c6d9260b32ccc781 (diff)
downloadluaotfload-b46f13e0949e310b46e97e791fd4e9e38635a491.tar.gz
for 2.6
Diffstat (limited to 'src/fontloader/misc/fontloader-mplib.tex')
-rw-r--r--src/fontloader/misc/fontloader-mplib.tex21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/fontloader/misc/fontloader-mplib.tex b/src/fontloader/misc/fontloader-mplib.tex
index 09dd179..f9de4b2 100644
--- a/src/fontloader/misc/fontloader-mplib.tex
+++ b/src/fontloader/misc/fontloader-mplib.tex
@@ -106,15 +106,14 @@
%D Text items have a special handler:
-\def\MPLIBtextext#1#2#3#4#5%
+\def\MPLIBtextext#1#2#3#4%
{\begingroup
\setbox\mplibscratchbox\hbox
{\font\temp=#1 at #2bp%
\temp
#3}%
\setbox\mplibscratchbox\hbox
- {\hskip#4 bp%
- \raise#5 bp%
+ {\raise#4sp%
\box\mplibscratchbox}%
\wd\mplibscratchbox0pt%
\ht\mplibscratchbox0pt%
@@ -122,4 +121,20 @@
\box\mplibscratchbox
\endgroup}
+\def\MPLIBpdftext#1#2%
+ {\ifcsname mplib::#1\endcsname
+ % already done, forgotten outside convert group
+ \message{<reusing mplib: #1>}%
+ \else
+ \message{<embedding mplib: #1>}%
+ \immediate\pdfximage{#1}% we cannot remove the file as it is included last
+ \expandafter\edef\csname mplib::#1\endcsname{\the\pdflastximage}%
+ \fi
+ \setbox\mplibscratchbox\hbox
+ {\raise#2sp\hbox{\pdfrefximage\csname mplib::#1\endcsname}}%
+ \wd\mplibscratchbox0pt%
+ \ht\mplibscratchbox0pt%
+ \dp\mplibscratchbox0pt%
+ \box\mplibscratchbox}
+
\endinput