diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/meta-pdf.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/meta-pdf.tex | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/context/base/meta-pdf.tex b/Master/texmf-dist/tex/context/base/meta-pdf.tex index ad4a57fd942..d5b7f202fcd 100644 --- a/Master/texmf-dist/tex/context/base/meta-pdf.tex +++ b/Master/texmf-dist/tex/context/base/meta-pdf.tex @@ -13,6 +13,8 @@ %D Formerly known as supp-pdf.tex and supp-mpe.tex. +%D We will clean up the color mess later. + %D These macros are written as generic as possible. Some %D general support macro's are loaded from a small module %D especially made for non \CONTEXT\ use. In this module I @@ -811,7 +813,7 @@ {\global\let\MPresolvedspace\MPcmykspace \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}% \def\dostartspotcolormode##1##2% - {\global\let\MPspotspace\empty + {\global\let\MPspotspace\empty % left over ? \xdef\MPresolvedspace{##1}% \xdef\MPresolvedcolor{##2}% \global\let\MPspotspace\MPresolvedspace}% signal @@ -961,4 +963,52 @@ % filldraw boundingbox currentpicture enlarged -3cm withpen pencircle scaled 1pt withcolor .5white ; % \stopMPcode +% This code will move to meta-pdf.mkiv and the call to lua will move to the +% converter code (saves a lua call). We will do this when we made the final +% move to attribute bases color. Actually, we cannot use attributes for +% switching colors in mp literals because grouping (qQ) interferes. + +\ifx\colorversion\undefined \else \ifnum\colorversion>\plusone + + \def\dohandleMPgraycolor #1{\ctxlua{ctx.pdffinishtransparency() + ctx.pdfgrayliteral(\the\currentcolormodel,#1)}} + \def\dohandleMPrgbcolor #1#2#3{\ctxlua{ctx.pdffinishtransparency() + ctx.pdfrgbliteral (\the\currentcolormodel,#1,#2,#3)}} + \def\dohandleMPcmykcolor#1#2#3#4{\ctxlua{ctx.pdffinishtransparency() + ctx.pdfcmykliteral(\the\currentcolormodel,#1,#2,#3,#4)}} + \def\dohandleMPspotcolor#1#2#3#4{\ctxlua{ctx.pdffinishtransparency() + ctx.pdfspotliteral(\the\currentcolormodel,"#1",#2,"#3","#4")}} + + % we can combine the next calls + + \def\dohandleMPgraytransparency #1#2#3{\ctxlua{ctx.pdfgrayliteral(\the\currentcolormodel,#1) + ctx.pdftransparencyliteral(#2,#3)}} + \def\dohandleMPrgbtransparency #1#2#3#4#5{\ctxlua{ctx.pdfrgbliteral (\the\currentcolormodel,#1,#2,#3) + ctx.pdftransparencyliteral(#4,#5)}} + \def\dohandleMPcmyktransparency#1#2#3#4#5#6{\ctxlua{ctx.pdfcmykliteral(\the\currentcolormodel,#1,#2,#3,#4) + ctx.pdftransparencyliteral(#5,#6)}} + \def\dohandleMPspottransparency#1#2#3#4#5#6{\ctxlua{ctx.pdfspotliteral(\the\currentcolormodel,"#1",#2,"#3","#4") + ctx.pdftransparencyliteral(#5,#6)}} + + \def\dohandleMPresettransparency {\ctxlua{ctx.pdffinishtransparency()}} + + \def\resolveMPgraycolor #1\to#2{\ctxlua{ctx.resolvempgraycolor("\strippedcsname#2","MPresolvedspace",\number\currentcolormodel,#1)}} + \def\resolveMPrgbcolor #1#2#3\to#4{\ctxlua{ctx.resolvemprgbcolor ("\strippedcsname#4","MPresolvedspace",\number\currentcolormodel,#1,#2,#3)}} + \def\resolveMPcmykcolor#1#2#3#4\to#5{\ctxlua{ctx.resolvempcmykcolor("\strippedcsname#5","MPresolvedspace",\number\currentcolormodel,#1,#2,#3,#4)}} + + \def\resolveMPspotcolor#1#2#3#4\to#5% unchecked + {\ctxlua{ctx.resolvempspotcolor("\strippedcsname#5","MPresolvedspace",\number\currentcolormodel,"#1",#2,"#3","#4")}% + \xdef\MPresolvedspace{#1}% + \xdef\MPresolvedcolor{#4}% + \global\let\MPspotspace\MPresolvedspace} + + % used as callers + + \let\MPSgray\dohandleMPgraycolor + \let\MPSrgb \dohandleMPrgbcolor + \let\MPScmyk\dohandleMPcmykcolor + \let\MPspot \dohandleMPspotcolor + +\fi \fi + \protect \endinput |