summaryrefslogtreecommitdiff
path: root/src/fontloader/misc/fontloader-mplib.tex
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-10-29 07:14:40 +0100
committerPhilipp Gesang <phg@phi-gamma.net>2015-10-29 07:14:40 +0100
commit4f053696e1813fde4bd6cebbb77ff2a1e1f6800b (patch)
tree308ec3223eec7744136e95c40284602ba35efacc /src/fontloader/misc/fontloader-mplib.tex
parentd7a36a33d8d57a5aec9232364cf0bd307523281c (diff)
downloadluaotfload-4f053696e1813fde4bd6cebbb77ff2a1e1f6800b.tar.gz
[fontloader] sync with Context as of 2015-10-29
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