diff options
Diffstat (limited to 'Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES')
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES | 238 |
1 files changed, 238 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES b/Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES new file mode 100644 index 00000000000..ce25525c7ef --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xespotcolor/PATCHES @@ -0,0 +1,238 @@ +--- 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 |