summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipsk/output.c')
-rw-r--r--Build/source/texk/dvipsk/output.c19
1 files changed, 19 insertions, 0 deletions
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;