diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-03-01 05:07:44 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-03-01 05:07:44 +0000 |
commit | ae8ee5cdb1282ebca15eebebacd1bfad1fe63136 (patch) | |
tree | 54bd6e00972311036f851f4c02f85f30d0687a40 /Build/source/texk/dvipdfm-x | |
parent | aed3672a0215ee490ad4bc344d52d4f36399943b (diff) |
texk/dvipdfm-x: Add a new option --fixorigin which disables the translation of the origin
git-svn-id: svn://tug.org/texlive/trunk@39897 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 8 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvipdfmx.c | 13 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvipdfmx.h | 1 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/mpost.c | 28 |
4 files changed, 38 insertions, 12 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index a0276ecd709..6d609c9d184 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,11 @@ +2016-03-01 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * dvipdfmx.c, dvipdfmx.h, mpost.c: Introduce a new option --fixorigin, + in order to support direct use of \special{psfile=mpostcreatedps}. + By default, assuming the use of dvipdfmx.def, or xetex.def, the origin + is translated suitably because dvipdfmx.def requires llx = lly = 0. + With the option --fixorigin, the translation of the origin is disabled. + 2016-02-25 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * dvipdfmx.c: Change the default value of pdfdecimaldigits from 2 diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx.c b/Build/source/texk/dvipdfm-x/dvipdfmx.c index 2336a242e5e..6bac502d709 100644 --- a/Build/source/texk/dvipdfm-x/dvipdfmx.c +++ b/Build/source/texk/dvipdfm-x/dvipdfmx.c @@ -64,6 +64,7 @@ #include "error.h" int is_xdv = 0; +int not_translate_origin = 0; const char *my_name; @@ -178,6 +179,7 @@ show_usage (void) printf (" --dvipdfm\tEnable DVIPDFM emulation mode\n"); printf (" -d number\tSet PDF decimal digits (0-5) [3]\n"); printf (" -f filename\tSet font map file name [pdftex.map]\n"); + printf (" --fixorigin\tDo not translate the origin for MP inclusion\n"); printf (" -g dimension\tAnnotation \"grow\" amount [0.0in]\n"); printf (" -h | --help \tShow this help message and exit\n"); printf (" -l \t\tLandscape mode\n"); @@ -393,6 +395,7 @@ static struct option long_options[] = { {"version", 0, 0, 130}, {"showpaper", 0, 0, 131}, {"dvipdfm", 0, 0, 132}, + {"fixorigin", 0, 0, 1000}, {"kpathsea-debug", 1, 0, 133}, {0, 0, 0, 0} }; @@ -419,6 +422,10 @@ do_early_args (int argc, char *argv[]) exit(0); break; + case 1000: /* --fixorigin */ + not_translate_origin = 1; + break; + case 'q': really_quiet = 2; break; @@ -460,7 +467,7 @@ do_args (int argc, char *argv[], const char *source) while ((c = getopt_long(argc, argv, optstrig, long_options, NULL)) != -1) { switch(c) { - case 'h': case 130: case 131: case 'q': case 'v': /* already done */ + case 'h': case 130: case 131: case 1000: case 'q': case 'v': /* already done */ break; case 132: /* --dvipdfm */ @@ -935,8 +942,8 @@ main (int argc, char *argv[]) opterr = 0; - /* Special-case single option --help, --showpaper, or --version, to avoid - possible diagnostics about config files, etc. + /* Special-case single option --fixorigin, --help, --showpaper, or --version, + to avoid possible diagnostics about config files, etc. Also handle -q and -v that cannot be set in config file. */ do_early_args(argc, argv); diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx.h b/Build/source/texk/dvipdfm-x/dvipdfmx.h index 7558986b30f..29b6816d3c4 100644 --- a/Build/source/texk/dvipdfm-x/dvipdfmx.h +++ b/Build/source/texk/dvipdfm-x/dvipdfmx.h @@ -27,6 +27,7 @@ extern int compat_mode; extern int is_xdv; +extern int not_translate_origin; extern const char *my_name; extern int extractbb(int argc, char *argv[]); diff --git a/Build/source/texk/dvipdfm-x/mpost.c b/Build/source/texk/dvipdfm-x/mpost.c index 154d4b3d767..4c1be75b647 100644 --- a/Build/source/texk/dvipdfm-x/mpost.c +++ b/Build/source/texk/dvipdfm-x/mpost.c @@ -50,6 +50,7 @@ #include "pdfximage.h" #include "mpost.h" +#include "dvipdfmx.h" /* * Define the origin as (llx, lly) in order to @@ -242,15 +243,24 @@ mps_scan_bbox (const char **pp, const char *endptr, pdf_rect *bbox) return -1; } else { /* The new xetex.def and dvipdfmx.def require bbox->llx = bbox->lly = 0. */ - bbox->llx = 0; - bbox->lly = 0; - bbox->urx = values[2] - values[0]; - bbox->ury = values[3] - values[1]; - - Xorigin = (double)values[0]; - Yorigin = (double)values[1]; - - return 0; + if (not_translate_origin == 0) { + bbox->llx = 0; + bbox->lly = 0; + bbox->urx = values[2] - values[0]; + bbox->ury = values[3] - values[1]; + + Xorigin = (double)values[0]; + Yorigin = (double)values[1]; + } else { + bbox->llx = values[0]; + bbox->lly = values[1]; + bbox->urx = values[2]; + bbox->ury = values[3]; + + Xorigin = 0.0; + Yorigin = 0.0; + } + return 0; } } skip_line (pp, endptr); |