summaryrefslogtreecommitdiff
path: root/tex/generic/context/mptopdf.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/generic/context/mptopdf.tex')
-rw-r--r--tex/generic/context/mptopdf.tex29
1 files changed, 29 insertions, 0 deletions
diff --git a/tex/generic/context/mptopdf.tex b/tex/generic/context/mptopdf.tex
index 84a8aa380..bb9f27d0c 100644
--- a/tex/generic/context/mptopdf.tex
+++ b/tex/generic/context/mptopdf.tex
@@ -112,6 +112,7 @@
\def\processMPfile#1 %
{\pdfoutput=1
+ \pdfpkresolution600
\pdfcompresslevel=9
\chardef\makeMPintoPDFobject=1
\hsize=100in
@@ -143,4 +144,32 @@
%D file can be converted to \EPS\ using for instance the
%D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT.
+%D A few helpers:
+
+{\catcode`\.=12
+ \catcode`\p=12
+ \catcode`\t=12
+ \gdef\WITHOUTPT#1pt{#1}}
+
+\def\withoutpt#1%
+ {\expandafter\WITHOUTPT#1}
+
+\def\negatecolorcomponent#1% #1 = \macro
+ {\scratchdimen1pt\advance\scratchdimen-#1\onepoint
+ \ifdim\scratchdimen<\zeropoint\scratchdimen\zeropoint\fi
+ \edef#1{\withoutpt\the\scratchdimen}}
+
+\let\negatedcolorcomponent\firstofoneargument
+
+\def\negatedcolorcomponent#1%
+ {\ifdim\dimexpr1pt-#1pt\relax<\zeropoint
+ 0pt%
+ \else
+ \expandafter\withoutpt\the\dimexpr1pt-#1pt\relax
+ \fi}
+
+\def\negatecolorcomponent#1% #1 = \macro
+ {\edef#1{\negatedcolorcomponent{#1}}}
+
+
\dump