summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-11-29 14:07:28 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-11-29 14:07:28 +0000
commit96286654c89384d81cac748889dc5a185e46af77 (patch)
treec6b2138b44b12ad4923c10bb95fb29528380c76e /Build
parentadf76fcc11d8aeb3c2a0cf65838e1fa4447de2e7 (diff)
texk/dvipdfm-x: Herbert requires -sPAPERSIZE=a0 in the case of PSTricks
git-svn-id: svn://tug.org/texlive/trunk@35693 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog6
-rw-r--r--Build/source/texk/dvipdfm-x/spc_dvips.c37
2 files changed, 39 insertions, 4 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index e501dd794c6..fbb1428a059 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-29 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * spc_dvips.c: In the case of PSTricks, use -sPAPERSIZE=a0 instead of
+ -dEPSCrop, since Herbert Voss wants it:
+ (http://tug.org/pipermail/xetex/2014-November/025664.html).
+
2014-11-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* dvipdfmx.test, xdvipdfmx.test: Also test --showpaper option.
diff --git a/Build/source/texk/dvipdfm-x/spc_dvips.c b/Build/source/texk/dvipdfm-x/spc_dvips.c
index e12a7276125..df628d78761 100644
--- a/Build/source/texk/dvipdfm-x/spc_dvips.c
+++ b/Build/source/texk/dvipdfm-x/spc_dvips.c
@@ -283,6 +283,7 @@ static char *global_defs = 0;
static char *page_defs = 0;
static char *temporary_defs = 0;
static char *distiller_template = 0;
+static char *pstricks_template = 0;
static pdf_coord *put_stack;
static int put_stack_depth = -1;
static char *gs_in = 0;
@@ -535,8 +536,21 @@ spc_handler_ps_tricks_parse_path (struct spc_env *spe, struct spc_arg *args)
const char *clip;
int error;
- if (!distiller_template)
+ if (!distiller_template) {
+ char *p;
distiller_template = get_distiller_template();
+ pstricks_template = xmalloc (strlen (distiller_template) + 14);
+ p = strstr (distiller_template, "-dEPSCrop");
+ if (p) {
+ memcpy (pstricks_template, distiller_template, p - distiller_template);
+ pstricks_template[p - distiller_template] = '\0';
+ strcat (pstricks_template, "-sPAPERSIZE=a0");
+ p += 9;
+ strcat (pstricks_template, p);
+ } else {
+ strcpy (pstricks_template, distiller_template);
+ }
+ }
pdf_dev_currentmatrix(&M);
if (!gs_in) {
@@ -603,7 +617,7 @@ spc_handler_ps_tricks_parse_path (struct spc_env *spe, struct spc_arg *args)
fprintf(fp, " showpage\n");
fclose(fp);
- error = dpx_file_apply_filter(distiller_template, gs_in, gs_out,
+ error = dpx_file_apply_filter(pstricks_template, gs_in, gs_out,
(unsigned char) pdf_get_version());
if (error) {
WARN("Image format conversion for PSTricks failed.");
@@ -636,8 +650,21 @@ spc_handler_ps_tricks_render (struct spc_env *spe, struct spc_arg *args)
int k;
pdf_tmatrix M;
- if (!distiller_template)
+ if (!distiller_template) {
+ char *p;
distiller_template = get_distiller_template();
+ pstricks_template = xmalloc (strlen(distiller_template) + 14);
+ p = strstr (distiller_template, "-dEPSCrop");
+ if(p) {
+ memcpy (pstricks_template, distiller_template, p - distiller_template);
+ pstricks_template[p - distiller_template] = '\0';
+ strcat (pstricks_template, "-sPAPERSIZE=a0");
+ p += 9;
+ strcat (pstricks_template, p);
+ } else {
+ strcpy (pstricks_template, distiller_template);
+ }
+ }
pdf_dev_currentmatrix(&M);
if (!gs_in) {
@@ -697,7 +724,7 @@ spc_handler_ps_tricks_render (struct spc_env *spe, struct spc_arg *args)
fprintf(fp, " showpage\n");
fclose(fp);
- error = dpx_file_apply_filter(distiller_template, gs_in, gs_out,
+ error = dpx_file_apply_filter(pstricks_template, gs_in, gs_out,
(unsigned char) pdf_get_version());
if (error) {
WARN("Image format conversion for PSTricks failed.");
@@ -907,6 +934,8 @@ spc_dvips_at_end_document (void)
}
dpx_delete_temp_file(global_defs, true);
dpx_delete_temp_file(page_defs, true);
+ if (pstricks_template)
+ RELEASE(pstricks_template);
return 0;
}