diff options
author | Karl Berry <karl@freefriends.org> | 2015-03-18 22:19:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-03-18 22:19:10 +0000 |
commit | 19dcc636657c83f928c71c3ad6cdc1c2dedb265f (patch) | |
tree | 6de2d817472d83763c77ced1449f6bc0510d1604 /Master/texmf-dist | |
parent | 3f21ad1106c152aa75655ef3ff6c9079047cef55 (diff) |
xespotcolor (18mar15)
git-svn-id: svn://tug.org/texlive/trunk@36555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES | 238 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xespotcolor/README | 21 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xespotcolor/spotcolor-test.pdf | bin | 481663 -> 70346 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xespotcolor/xespotcolor.pdf | bin | 60607 -> 61014 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx | 37 | ||||
-rw-r--r-- | Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.ins | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty | 10 |
7 files changed, 33 insertions, 279 deletions
diff --git a/Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES b/Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES deleted file mode 100644 index ce25525c7ef..00000000000 --- a/Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES +++ /dev/null @@ -1,238 +0,0 @@ ---- pdfcolor.c.orig 2014-07-30 22:27:05.423428483 +0300 -+++ pdfcolor.c 2014-08-13 22:59:53.862311266 +0300 -@@ -27,6 +27,7 @@ - #include <config.h> - #endif - -+#include <strings.h> - #include "system.h" - #include "mem.h" - #include "error.h" -@@ -79,6 +80,8 @@ - - color->num_components = 3; - -+ bzero(color->SpotColorName, 256); -+ - return 0; - } - -@@ -112,6 +115,7 @@ - - color->num_components = 4; - -+ bzero(color->SpotColorName, 256); - return 0; - } - -@@ -129,6 +133,27 @@ - - color->num_components = 1; - -+ bzero(color->SpotColorName, 256); -+ -+ return 0; -+} -+ -+int -+pdf_color_spotcolor (pdf_color *color, char* spot_color_name, double c) -+{ -+ ASSERT(color); -+ -+ if (c < 0.0 || c > 1.0) { -+ WARN("Invalid color value specified: grade=%g", c); -+ return -1; -+ } -+ -+ color->values[0] = c; -+ -+ color->num_components = 2; -+ -+ strcpy(color->SpotColorName, spot_color_name); -+ - return 0; - } - -@@ -190,24 +215,35 @@ - return 1; - } - --int --pdf_color_to_string (const pdf_color *color, char *buffer) -+int -+pdf_color_to_string (const pdf_color *color, char *buffer, char mask) - { - int i, len = 0; - -- for (i = 0; i < color->num_components; i++) { -- len += sprintf(buffer+len, " %g", ROUND(color->values[i], 0.001)); -+ if ( (-color->num_components) == PDF_COLORSPACE_TYPE_SPOT ) { -+ if (mask == '0') { -+ len += sprintf(buffer+len, " /%s CS %g SC", color->SpotColorName, ROUND(color->values[0], 0.001)); -+ } -+ else { -+ len += sprintf(buffer+len, " /%s cs %g sc", color->SpotColorName, ROUND(color->values[0], 0.001)); -+ } - } -+ else { -+ for (i = 0; i < color->num_components; i++) { -+ len += sprintf(buffer+len, " %g", ROUND(color->values[i], 0.001)); -+ } -+ } -+ - return len; - } - - pdf_color current_fill = { -- 1, -+ 1, {'\0'}, - {0.0, 0.0, 0.0, 0.0} - }; - - pdf_color current_stroke = { -- 1, -+ 1, {'\0'}, - {0.0, 0.0, 0.0, 0.0} - }; - -@@ -244,6 +280,9 @@ - { - int n; - -+ if ( color->SpotColorName[0] != '\0' ) -+ return 1; -+ - n = color->num_components; - switch (n) { - case 1: /* Gray */ -@@ -265,7 +304,7 @@ - - /* Dvipdfm special */ - pdf_color default_color = { -- 1, -+ 1, {'\0'}, - {0.0, 0.0, 0.0, 0.0} - }; - ---- pdfcolor.h.orig 2014-07-24 21:57:12.649698246 +0300 -+++ pdfcolor.h 2014-08-06 23:31:39.430330177 +0300 -@@ -37,6 +37,7 @@ - #define PDF_COLORSPACE_TYPE_CMYK PDF_COLORSPACE_TYPE_DEVICECMYK - #define PDF_COLORSPACE_TYPE_RGB PDF_COLORSPACE_TYPE_DEVICERGB - #define PDF_COLORSPACE_TYPE_GRAY PDF_COLORSPACE_TYPE_DEVICEGRAY -+#define PDF_COLORSPACE_TYPE_SPOT -2 - - - #define PDF_COLOR_COMPONENT_MAX 4 -@@ -44,6 +45,7 @@ - typedef struct - { - int num_components; -+ char SpotColorName[255]; - double values[PDF_COLOR_COMPONENT_MAX]; - } pdf_color; - -@@ -54,6 +56,9 @@ - extern int pdf_color_cmykcolor (pdf_color *color, - double c, double m, double y, double k); - extern int pdf_color_graycolor (pdf_color *color, double g); -+ -+extern int pdf_color_spotcolor (pdf_color *color, -+ char* spot_color_name, double c); - extern void pdf_color_copycolor (pdf_color *color1, const pdf_color *color2); - - #define pdf_color_black(c) pdf_color_graycolor(c, 0.0); -@@ -63,7 +68,7 @@ - - extern int pdf_color_type (const pdf_color *color); - extern int pdf_color_compare (const pdf_color *color1, const pdf_color *color2); --extern int pdf_color_to_string (const pdf_color *color, char *buffer); -+extern int pdf_color_to_string (const pdf_color *color, char *buffer, char mask); - - extern int pdf_color_is_white (const pdf_color *color); - extern int pdf_color_is_valid (const pdf_color *color); ---- pdfdraw.c.orig 2014-08-01 23:26:17.454362614 +0300 -+++ pdfdraw.c 2014-08-13 22:56:05.927819086 +0300 -@@ -1260,7 +1260,7 @@ - * the color is the same as the current graphics state color - */ - void --pdf_dev_set_color (const pdf_color *color, char mask, int force) -+pdf_dev_set_color (const pdf_color *color, char mask, int force) - { - int len; - -@@ -1269,7 +1269,7 @@ - - ASSERT(pdf_color_is_valid(color)); - -- if (!(pdf_dev_get_param(PDF_DEV_PARAM_COLORMODE) && -+ if (!(pdf_dev_get_param(PDF_DEV_PARAM_COLORMODE) && - (force || pdf_color_compare(color, current)))) - /* If "color" is already the current color, then do nothing - * unless a color operator is forced -@@ -1277,7 +1277,7 @@ - return; - - graphics_mode(); -- len = pdf_color_to_string(color, fmt_buf); -+ len = pdf_color_to_string(color, fmt_buf, mask); - fmt_buf[len++] = ' '; - switch (pdf_color_type(color)) { - case PDF_COLORSPACE_TYPE_RGB: -@@ -1293,7 +1293,7 @@ - default: /* already verified the given color */ - break; - } -- pdf_doc_add_page_content(fmt_buf, len); /* op: RG K G rg k g */ -+ pdf_doc_add_page_content(fmt_buf, len); /* op: RG K G rg k g etc. */ - - pdf_color_copycolor(current, color); - } ---- spc_util.c.orig 2014-07-17 16:35:39.531113864 +0300 -+++ spc_util.c 2014-08-04 23:29:53.857556810 +0300 -@@ -38,7 +38,6 @@ - - #include "spc_util.h" - -- - #ifndef ISBLANK - #define ISBLANK(c) ((c) == ' ' || (c) == '\t') - #endif -@@ -111,6 +110,7 @@ - spc_read_color_color (struct spc_env *spe, pdf_color *colorspec, struct spc_arg *ap) - { - char *q; -+ char *spotColorName; - double cv[4]; - int nc; - int error = 0; -@@ -146,6 +146,20 @@ - } else { - pdf_color_graycolor(colorspec, cv[0]); - } -+ } else if (!strcmp(q, "spot")) { /* Handle spot colors */ -+ spotColorName = parse_c_ident(&ap->curptr, ap->endptr); -+ if (!spotColorName) { -+ spc_warn(spe, "No valid spot color name specified?"); -+ return -1; -+ } -+ skip_blank(&ap->curptr, ap->endptr); -+ nc = spc_util_read_numbers(cv, 1, spe, ap); -+ if (nc != 1) { -+ spc_warn(spe, "Invalid value for spot color specification."); -+ error = -1; -+ } else { -+ pdf_color_spotcolor(colorspec, spotColorName, cv[0]); -+ } - } else if (!strcmp(q, "hsb")) { - nc = spc_util_read_numbers(cv, 3, spe, ap); - if (nc != 3) { -@@ -236,7 +250,6 @@ - if (ap->curptr >= ap->endptr) { - return -1; - } -- - if (syntax) - return spc_read_color_color(spe, colorspec, ap); - else diff --git a/Master/texmf-dist/doc/xelatex/xespotcolor/README b/Master/texmf-dist/doc/xelatex/xespotcolor/README index a755c9e9c91..57169d9ac70 100644 --- a/Master/texmf-dist/doc/xelatex/xespotcolor/README +++ b/Master/texmf-dist/doc/xelatex/xespotcolor/README @@ -5,21 +5,10 @@ by Jens Elstner is a first attempt to introduce the use of spot colors with pdfLaTeX. The xespotcolor package is a reimplementation of this package so to be usable with XeLaTeX. As such, it has the same user interface and -the same capabilities. - -Currently, xdvipdfm-x does not support the spot command, -which is needed in order to be able top use commands like -the following one: - -\definecolor{Spots}{spotcolor}{SOMECOLOR,1.0} - -File PATCHES contains patches that should be applied to the -source code of xdvipdfm-x so to be able to deal with such -commands. Also, file spotcolor-test.tex is test file based on -the documentation of the original package. Finally, file -spotcolor-test.pdf cannot be produced with a current TeX -installation. When the source code of xdvipdfm-x will be -updated, then the contents of this folder will change. +the same capabilities. The latest version of xdvipdfm-x +(svn revision 36553) has been modified to handle spot colors. +So one needs a very recent version of xdvipdfm-x in order to +run the test file revision 36553. Apostolos Syropoulos -2014/11/13 +2015/03/18 diff --git a/Master/texmf-dist/doc/xelatex/xespotcolor/spotcolor-test.pdf b/Master/texmf-dist/doc/xelatex/xespotcolor/spotcolor-test.pdf Binary files differindex 1ca0367f644..28e70ea54f4 100644 --- a/Master/texmf-dist/doc/xelatex/xespotcolor/spotcolor-test.pdf +++ b/Master/texmf-dist/doc/xelatex/xespotcolor/spotcolor-test.pdf diff --git a/Master/texmf-dist/doc/xelatex/xespotcolor/xespotcolor.pdf b/Master/texmf-dist/doc/xelatex/xespotcolor/xespotcolor.pdf Binary files differindex 22ee859858b..5ea7cf1cf54 100644 --- a/Master/texmf-dist/doc/xelatex/xespotcolor/xespotcolor.pdf +++ b/Master/texmf-dist/doc/xelatex/xespotcolor/xespotcolor.pdf diff --git a/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx b/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx index 847374f9785..9dd7cd83c92 100644 --- a/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx +++ b/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx @@ -16,7 +16,7 @@ %% %\iffalse % -% (c) Copyright 2014 Apostolos Syropoulos +% (c) Copyright 2014-2015 Apostolos Syropoulos % This program can be redistributed and/or modified under the % terms of the LaTeX Project Public License Distributed from % http://www.latex-project.org/lppl.txt; either @@ -34,7 +34,7 @@ % %<xespotcolor, >\ProvidesFile{xesporcolor.sty} % -%<xespotcolor, > [2014/11/12 v1.0 Package `xespotcolor.sty'] +%<xespotcolor, > [2015/03/18 v1.1 Package `xespotcolor.sty' (bug fix release)] % % \begin{macrocode} %<*driver> @@ -57,7 +57,7 @@ %\author{Apostolos Syropoulos\\ % Xanthi, Greece\\ % \texttt{asyropoulos@yahoo.com}} -% \date{2014/11/12} +% \date{2015/03/18} %\maketitle % \begin{abstract} % A spot color is one that is printed with its own ink. Typically, printers use spot colors @@ -101,14 +101,14 @@ % used by the |\pdfrefobj| primitive. After some experimentation and some… Googling, I have found out that the following % \XeTeX\ code is a reasonable translation of the previous code snipper: % \begin{center} -% |\newcount\CNT |\\ -% |\newtoks\TOK |\\ -% |\TOK={@TOK \the\CNT}% |\\ -% |\advance\CNT by1% |\\ -% |\edef\A{\the\TOK Raw PDF code 1}%|\\ -% |\edef\B{Raw PDF code \the\TOK}% |\\ -% |\special{pdf:obj \A}% |\\ -% |\special{pdf:obj \B}% |\\ +% |\newcount\CNT |\\ +% |\newtoks\TOK |\\ +% |\TOK={@TOK \the\CNT}% |\\ +% |\edef\A{\the\TOK Raw PDF code 1}% |\\ +% |\edef\B{Raw PDF code \the\TOK}% |\\ +% |\special{pdf:obj \A}% |\\ +% |\special{pdf:obj @TOKB\the\CNT \B}% |\\ +% |\advance\CNT by1% |\\ % \end{center} % The two |\edef|initions are used to do the work done by |\pdfobj|. Note that here there I introduce only % one unique object and the first two lines define a counter and a token variable. The token variable uses @@ -142,7 +142,7 @@ %<*xespotcolor> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xespotcolor} - [2014/11/12 v.1.0, Package for adding Spot Color support to XeLaTeX.] + [2015/03/18 v.1.1, Package for adding Spot Color support to XeLaTeX.] % \end{macrocode} % The package needs three packages in to operate properly: \textsf{graphics}, \textsf{color}, and \textsf{everypage}. % The first two packages must be loaded with the \texttt{xetex} option, since auto-detection does not work in this case. @@ -199,12 +199,11 @@ \newtoks\mycolorprofilename % \end{macrocode} % Macro |\AddSpotColor| first defines a new color profile by assigning a value to |\mycolorprofilename|. The name -% consists of the word |@mycolorprofile| followed by an integer. And since all names must be distinct -% the macro increments the value of the |\colorprofilecnt| counter by one. +% consists of the word |@mycolorprofile| followed by an integer. This name is used in the construction of the +% corresponding PDF object. % \begin{macrocode} \def\AddSpotColor#1#2#3#4{% \mycolorprofilename={@mycolorprofile\the\colorprofilecnt}% - \advance\colorprofilecnt by1% % \end{macrocode} % The following two macros expand to PDF instructions that define the spot color. The PDF instructions are copied verbatim from % the original \textsf{spotcolor} package. @@ -219,10 +218,14 @@ \expandafter\csgrab\expandafter{\tempcs}{\csname #1\endcsname}% % \end{macrocode} % In the last part of the macro definition, the driver is instructed to build two objects which should contain the definition of -% the new spot color. +% the new spot color. Note that here the macro specifies explicitly the object reference for the second object. % \begin{macrocode} \special{pdf:obj \mycolorprofile}% - \special{pdf:obj \mycolor}% + \special{pdf:obj @myowncolor\the\colorprofilecnt \mycolor}% +% \end{macrocode} +% Since all names must be distinct the macro increments the value of the |\colorprofilecnt| counter by one. +% \begin{macrocode} + \advance\colorprofilecnt by1% } % \end{macrocode} % diff --git a/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.ins b/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.ins index a801d2ddafb..c476fbfa99e 100644 --- a/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.ins +++ b/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.ins @@ -1,9 +1,9 @@ -%% Copyright 2014 Apostolos Syropoulos +%% Copyright 2014-2015 Apostolos Syropoulos %% %% This file is part of the `decimal' package. %% You are not allowed to modify its contents. %% -\def\filedate{2014/11/13} +\def\filedate{2015/03/18} \def\batchfile{xespotcolor.ins} \input docstrip.tex @@ -24,7 +24,7 @@ \preamble - (c) Copyright 2007—2013 Apostolos Syropoulos + (c) Copyright 2014-2015 Apostolos Syropoulos This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from http://www.latex-project.org/lppl.txt; either diff --git a/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty b/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty index 9481a1dc24b..b0a6e5fcf03 100644 --- a/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty +++ b/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty @@ -6,7 +6,7 @@ %% %% xespotcolor.dtx (with options: `xespotcolor') %% -%% (c) Copyright 2007—2013 Apostolos Syropoulos +%% (c) Copyright 2014-2015 Apostolos Syropoulos %% This program can be redistributed and/or modified under the %% terms of the LaTeX Project Public License Distributed from %% http://www.latex-project.org/lppl.txt; either @@ -36,10 +36,10 @@ %% Right brace \} Tilde \~} %% \ProvidesFile{xesporcolor.sty} - [2014/11/12 v1.0 Package `xespotcolor.sty'] + [2015/03/18 v1.1 Package `xespotcolor.sty' (bug fix release)] \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xespotcolor} - [2014/11/12 v.1.0, Package for adding Spot Color support to XeLaTeX.] + [2015/03/18 v.1.1, Package for adding Spot Color support to XeLaTeX.] \RequirePackage[xetex]{graphics} \RequirePackage[xetex]{color} \RequirePackage{everypage} @@ -60,14 +60,14 @@ \newtoks\mycolorprofilename \def\AddSpotColor#1#2#3#4{% \mycolorprofilename={@mycolorprofile\the\colorprofilecnt}% - \advance\colorprofilecnt by1% \edef\mycolorprofile{\the\mycolorprofilename <</C0[0 0 0 0]/FunctionType 2/C1[#4]/Domain[0 1]/N 1>>}% \edef\mycolor{[/Separation/#3 /DeviceCMYK \the\mycolorprofilename]}% \edef\tempcs{/#2 \mycolor}% \expandafter\csgrab\expandafter{\tempcs}{\csname #1\endcsname}% \special{pdf:obj \mycolorprofile}% - \special{pdf:obj \mycolor}% + \special{pdf:obj @myowncolor\the\colorprofilecnt \mycolor}% + \advance\colorprofilecnt by1% } \def\SetPageColorResource#1{% \AddEverypageHook{\special{pdf:put @resources <</ColorSpace <<#1>>>>}}% |