summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/colo-ini.tex34
-rw-r--r--tex/context/base/core-fig.tex6
-rw-r--r--tex/context/base/spec-def.tex5
-rw-r--r--tex/context/base/spec-fdf.tex24
-rw-r--r--tex/context/base/spec-tpd.tex28
5 files changed, 85 insertions, 12 deletions
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index 2e0d6bd92..caed6a63e 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -1116,6 +1116,32 @@
\flushatshipout{\hbox{\localcolortrue\color[#1]}}% index one
\egroup}
+\def\checkpredefinedcolor[#1]%
+ {\ifcase\internalspotcolorsize{#1}\relax
+ \@EA\predefinecolor\or\@EA\predefinecolor\else\@EA\predefineindexcolor
+ \fi[#1]}
+
+%D \startbuffer
+%D \definecolor [blue] [c=1,m=.38,y=0,k=.64] % pantone pms 2965 uncoated m
+%D \definecolor [yellow] [c=0,m=.28,y=1,k=.06] % pantone pms 124 uncoated m
+%D
+%D \definecolor [blue-100] [blue] [p=1]
+%D \definecolor [yellow-100] [yellow] [p=1]
+%D
+%D \definemultitonecolor [pdftoolscolor] [blue=.12,yellow=.28] [c=.1,m=.1,y=.3,k=.1]
+%D
+%D \useexternalfigure[demofig][mill.png][object=no]
+%D
+%D \startcombination[4*1]
+%D {\externalfigure[demofig]} {no color}
+%D {\externalfigure[demofig][color=pdftoolscolor]} {indexed duotone}
+%D {\externalfigure[demofig][color=blue-100]} {spot color}
+%D {\externalfigure[demofig][color=yellow-100]} {spot color}
+%D \stopcombination
+%D \stopbuffer
+%D
+%D \getbuffer \typebuffer
+
%D Transparency is handled similar for all three color modes. We
%D can turn transparency off with the following switch:
@@ -2602,6 +2628,14 @@
\else 0%
\fi\fi\fi\fi]}
+% a few more obscure ones:
+
+\def\internalspotcolorname#1{\handlecolorwith\dointernalspotcolorname\csname\??cr#1\endcsname:::::::\end}
+\def\internalspotcolorsize#1{\handlecolorwith\dointernalspotcolorsize\csname\??cr#1\endcsname:::::::\end}
+
+\def\dointernalspotcolorname#1:#2:#3:#4:#5:#6:#7:#8\end{\if#1P\ifcase0#3 #1\else#2\fi\else#1\fi}
+\def\dointernalspotcolorsize#1:#2:#3:#4:#5:#6:#7:#8\end{\if#1P\ifcase0#3 0\else#3\fi\else 0\fi}
+
%D \macros
%D {everyshapebox}
%D
diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex
index fa47c0639..d90c0287e 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -983,6 +983,7 @@
\c!maxwidth=\@@exmaxwidth,\c!maxheight=\@@exmaxheight,
\c!scale=,\c!width=,\c!height=,\c!display=,\c!lines=,\c!grid=,
%\c!foregroundcolor=,
+ \c!color=,
\c!factor=,\c!hfactor=,\c!wfactor=]%
\doif\@@efextension\c!mov\presetfiguremov
\doif\@@efextension\c!avi\presetfigureavi
@@ -1012,6 +1013,11 @@
{\getparameters[\??ef]
[\c!background={\v!foreground,\v!color},
\c!backgroundcolor=\@@efforegroundcolor]}%
+ \doifsomething\@@efcolor
+ {\doifcolorelse\@@efcolor
+ {\checkpredefinedcolor[\@@efcolor]%
+ \doregisterfigurecolor\@@efcolor}}%
+ \donothing
%
\doif\@@efreset\v!yes \resetexternalfigures
\doif\@@eftype \c!mov\presetfiguremov
diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex
index e949dd17e..d24d257c7 100644
--- a/tex/context/base/spec-def.tex
+++ b/tex/context/base/spec-def.tex
@@ -693,7 +693,7 @@
\installspecial [\doresetobjects] [or] [0]
%D \macros
-%D {doregisterfigure}
+%D {doregisterfigure, doregisterfigurecolor}
%D
%D Images can be objects as well and it's up to the driver to
%D handle this. Alternative images are also up to the driver,
@@ -703,7 +703,8 @@
%D moment it suits its purpose: low res screen versions combined
%D with high res printable ones.
-\installspecial [\doregisterfigure][or] [2]
+\installspecial [\doregisterfigure] [or] [2]
+\installspecial [\doregisterfigurecolor][or] [1]
% %D \macros
% %D {dogetobjectreference}
diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex
index 819be008e..f1e7ed7df 100644
--- a/tex/context/base/spec-fdf.tex
+++ b/tex/context/base/spec-fdf.tex
@@ -1328,19 +1328,19 @@
\def\@@FDFflag{FDFflag}
\def\@@FDFplus{FDFplus}
-\letvalue {\@@FDFflag\v!readonly}=\FDFflagReadOnly
-\letvalue {\@@FDFflag\v!required}=\FDFflagRequired
-\letvalue {\@@FDFflag\v!protected}=\FDFflagPassword
+\letvalue {\@@FDFflag\v!readonly}=\FDFflagReadOnly
+\letvalue {\@@FDFflag\v!required}=\FDFflagRequired
+\letvalue {\@@FDFflag\v!protected}=\FDFflagPassword
\letvalue {\@@FDFflag\v!sorted}=\FDFflagSort
\letvalue {\@@FDFflag\v!unavailable}=\FDFflagNoExport
-\letvalue {\@@FDFflag\v!nocheck}=\FDFflagDoNotSpellCheck
-\letvalue {\@@FDFflag\v!fixed}=\FDFflagDoNotScroll
-\letvalue {\@@FDFflag\v!file}=\FDFflagFileSelect
+\letvalue {\@@FDFflag\v!nocheck}=\FDFflagDoNotSpellCheck
+\letvalue {\@@FDFflag\v!fixed}=\FDFflagDoNotScroll
+\letvalue {\@@FDFflag\v!file}=\FDFflagFileSelect
-\letvalue {\@@FDFplus\v!hidden}=\FDFplusHidden
-\letvalue {\@@FDFplus\v!printable}=\FDFplusPrintable
+\letvalue {\@@FDFplus\v!hidden}=\FDFplusHidden
+\letvalue {\@@FDFplus\v!printable}=\FDFplusPrintable
-\letvalue {\@@FDFplus\v!auto}=\FDFplusAutoView
+\letvalue {\@@FDFplus\v!auto}=\FDFplusAutoView
%D A set of switches is collected into the flags we mentioned
%D before by the next macro (we don't handle negations yet,
@@ -2834,6 +2834,12 @@
{\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}%
{pop}}
+\def\doPDFregisterfigurecolor#1%
+ {\dogetobjectreference
+ {PDF\ifcase\internalspotcolorsize{#1} CS\or CS\else IX\fi}
+ {\internalspotcolorname{#1}}
+ \PDFimagecolorreference}
+
%D \macros
%D {doPDFstartrotation,doPDFstoprotation}
%D
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex
index d9fdfb2d8..38cc014f1 100644
--- a/tex/context/base/spec-tpd.tex
+++ b/tex/context/base/spec-tpd.tex
@@ -384,6 +384,13 @@
%D themselves have alternatives, especially cylcic
%D dependencies.
+% some day we will do a proper check on bitmap depth,
+%
+% \pdfobj reserveobjnum\relax
+% \pdfximage colorspace \pdflastobj {some file}
+% ... \pdflastximagecolordepth ...
+% \immediate\pdfobj useobjnum \pdflastobj {some spec}
+
\ifx\@@DriverImageBox\undefined \def\@@DriverImageBox{artbox} \fi
\ifnum\pdftexversion>13
@@ -399,6 +406,18 @@
{attr {/Alternates \the\pdflastobj\space0 R}}%
\fi}
+\global\let\PDFimagecolorreference\empty
+
+\def\checkpdfimagecolorspecs
+ {\ifx\pdflastximagecolordepth \undefined
+ \global\let\pdfimagecolorspecs\empty
+ \else\ifx\PDFimagecolorreference\empty
+ \global\let\pdfimagecolorspecs\empty
+ \else
+ \xdef\pdfimagecolorspecs{colorspace \PDFimagecolorreference\space}%
+ \fi\fi
+ \global\let\PDFimagecolorreference\empty}
+
\def\dogetTPDfiguresize#1#2#3#4#5#6#7%
{\ifmeasureTPDfiguresize
#4\zeropoint
@@ -416,9 +435,14 @@
\the\everyPDFximage
\checkpdfimagepagenumber{#3}%
\checkpdfimageattributes
+ \checkpdfimagecolorspecs
\global\setbox\foundexternalfigure\hbox
{\immediate\pdfximage
- \pdfimageattributes \pdfimagepagenumber \@@DriverImageBox {#2}%
+ \pdfimageattributes
+ \pdfimagecolorspecs
+ \pdfimagepagenumber
+ \@@DriverImageBox
+ {#2}%
\xdef\PDFimagereference{\the\pdflastximage}%
\xdef\nofinsertpages{\the\pdflastximagepages}%
\pdfrefximage\pdflastximage}%
@@ -531,6 +555,8 @@
\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor}
\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor}
+\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor}
+
\definespecial\dostartnonecolormode{\doPDFstartnonecolormode}
\definespecial\doregisternonecolor {\doPDFregisternonecolor}