summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog9
-rw-r--r--Build/source/texk/dvipsk/loadfont.c2
-rw-r--r--Build/source/texk/dvipsk/output.c19
-rw-r--r--Build/source/texk/dvipsk/protos.h3
4 files changed, 33 insertions, 0 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index c032c1ef3d1..fab019a62f5 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,3 +1,12 @@
+2020-02-29 Tomas Rokicki <rokicki@gmail.com>
+
+ * loadfont.c (bitmapfontseen): define new global.
+ (loadfont): set it, if a bitmap font is seen.
+ * protos.h (bitmapfontseen): declare it.
+ * output.c (initprinter): If bitmapfontseen, emit
+ %%ViewingOrientation comment to try to cope with Distiller's
+ auto-orientation (page rotation).
+
2020-01-30 Karl Berry <karl@freefriends.org>
* Makefile.am (enc_DATA): new variable, for new file dvips-all.enc.
diff --git a/Build/source/texk/dvipsk/loadfont.c b/Build/source/texk/dvipsk/loadfont.c
index 6647a2f71b1..a9e1b14260d 100644
--- a/Build/source/texk/dvipsk/loadfont.c
+++ b/Build/source/texk/dvipsk/loadfont.c
@@ -29,6 +29,7 @@
char errbuf[1500];
int lastresortsizes[40];
+int bitmapfontseen = 0 ;
/*
* Now we have some routines to get stuff from the PK file.
* Subroutine pkbyte returns the next byte.
@@ -341,6 +342,7 @@ loadfont(register fontdesctype *curfnt)
tfmload(curfnt);
return;
}
+ bitmapfontseen = 1 ;
curfnt->dir = 0;
if (!quiet) {
if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) {
diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c
index 1d7a7288ec3..8a72696cb7c 100644
--- a/Build/source/texk/dvipsk/output.c
+++ b/Build/source/texk/dvipsk/output.c
@@ -1468,6 +1468,25 @@ initprinter(sectiontype *sect)
tell_needed_fonts();
paperspec(finpapsiz->specdat, 1);
fprintf(bitfile, "%%%%EndComments\n");
+/*
+ * If we encode Type 3 fonts with an encoding vector, this can cause
+ * Distiller's autoorientation to get confused. We remedy this by
+ * emitting underdocumented ViewingOrientation comments right after
+ * EndComments. Known defect: if a user "flips" the landscape to be
+ * 180 degrees using one of the \special{} commands available, the
+ * document will be rendered in the viewer upside down. (But only
+ * with bitmap font encoding enabled and bitmapped fonts actually used.)
+ * --tgr, 29 February 2020.
+ */
+ if (encodetype3 && bitmapfontseen) {
+ fprintf(bitfile, "%%%%BeginDefaults\n") ;
+ if (landscape) {
+ fprintf(bitfile, "%%%%ViewingOrientation: 0 -1 1 0\n") ;
+ } else {
+ fprintf(bitfile, "%%%%ViewingOrientation: 1 0 0 1\n") ;
+ }
+ fprintf(bitfile, "%%%%EndDefaults\n") ;
+ }
}
{
int i, len;
diff --git a/Build/source/texk/dvipsk/protos.h b/Build/source/texk/dvipsk/protos.h
index 3de2aedd139..9264626c22f 100644
--- a/Build/source/texk/dvipsk/protos.h
+++ b/Build/source/texk/dvipsk/protos.h
@@ -423,4 +423,7 @@ extern char realnameoffile[];
/* global variables from tfmload.c */
extern FILE *tfmfile;
+/* global variables from loadfont.c */
+extern int bitmapfontseen ;
+
#endif