summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2007-12-05 13:56:00 +0100
committerHans Hagen <pragma@wxs.nl>2007-12-05 13:56:00 +0100
commit6312e2b2913bc7de6f3c0ba30b993e2b4714edf1 (patch)
treee0e90382ddb930a0b4f534824892235b343dcdc4 /tex/generic
parent19af23ac5cb927d986a64ac1dc52ed2d7bad2450 (diff)
downloadcontext-6312e2b2913bc7de6f3c0ba30b993e2b4714edf1.tar.gz
stable 2007.12.05 13:56
Diffstat (limited to 'tex/generic')
-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