summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-03-29 10:27:10 +0100
committerSam James <sam@gentoo.org>2022-04-17 12:53:05 +0100
commit085bde903b9e684c3c1160e4df912bea9a660997 (patch)
treec4f5e6e9f2422e869ca5bc0b944520d451001282 /lib
parentImport Ghostscript 9.55 (diff)
downloadghostscript-gpl-patches-085bde903b9e684c3c1160e4df912bea9a660997.tar.gz
ghostscript-gpl-patches-085bde903b9e684c3c1160e4df912bea9a660997.tar.bz2
ghostscript-gpl-patches-085bde903b9e684c3c1160e4df912bea9a660997.zip
Import Ghostscript 9.56.0ghostscript-9.56
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/gslp.ps20
-rw-r--r--lib/gssetgs.bat2
-rw-r--r--lib/viewjpeg.ps2
3 files changed, 21 insertions, 3 deletions
diff --git a/lib/gslp.ps b/lib/gslp.ps
index 9a3a2f3e..b2cb80df 100644
--- a/lib/gslp.ps
+++ b/lib/gslp.ps
@@ -411,6 +411,15 @@ lpdict begin
/prevHFont null def
/lpfirst { % - lpfirst -
+ % If writing to file we need to emit the definition of 'encoding' or it will
+ % produce non-working PostScript. If we are executing directly then encoding is
+ % already defined. This defines encoding as an array instead of a name, but it will work OK
+ % and avoids changing the /RE procedure.
+ OutFile null eq not {
+ OutFile (/encoding /) writestring
+ OutFile encoding 256 string cvs writestring
+ OutFile ( /Encoding findresource def\n) writestring
+ } if
% Define some abbreviating procedures.
/B {save 3 1 roll translate /X 0 def} lpdef
/BL {save 3 1 roll 90 rotate translate /X 0 def} lpdef
@@ -610,7 +619,16 @@ lpdict begin
/--duplex { /Duplex {Landscape} def } def
/--duplex-long-edge { /Duplex false def } def
/--duplex-short-edge { /Duplex true def } def
-/--encoding { cvn /encoding exch def } def
+/--encoding {
+ cvn /encoding exch def
+ %% If we changed the encoding, then we need to remake the default fonts with the correct encoding
+ /defaultBodyFontPortrait
+ /Courier find-latin-font 10 scalefont def
+ /defaultBodyFontLandscape
+ /Courier find-latin-font 7 scalefont def
+ /defaultBodyFont
+ { Landscape { defaultBodyFontLandscape } { defaultBodyFontPortrait } ifelse } def
+} def
/--first-page { cvi /PageFirst exch def } def
/--footing-center { /FootingCenter exch def /Footers true def } def
/--footing-left { /FootingLeft exch def /Footers true def } def
diff --git a/lib/gssetgs.bat b/lib/gssetgs.bat
index 7c0b8000..8317261a 100644
--- a/lib/gssetgs.bat
+++ b/lib/gssetgs.bat
@@ -12,6 +12,6 @@ if %GS/==/ set GS=gswin32
if NOT %GSC%/==/ goto :gscset
if EXIST %~dp0..\bin\gswin32c.exe set GSC=%~dp0..\bin\gswin32c
-if EXIST %~dp0..\bin\gswin64c.exe set GS=%~dp0..\bin\gswin64c
+if EXIST %~dp0..\bin\gswin64c.exe set GSC=%~dp0..\bin\gswin64c
if %GSC%/==/ set GSC=gswin32c
:gscset
diff --git a/lib/viewjpeg.ps b/lib/viewjpeg.ps
index 554048df..71cb5d44 100644
--- a/lib/viewjpeg.ps
+++ b/lib/viewjpeg.ps
@@ -157,7 +157,7 @@ end % JPEGdict
} bind def
% This lets you do stuff on the command line like:
-% gs -sDEVICE=pdfwrite -o stuff%03d.pdf viewjpeg.ps -c "(image.jpg) << /PageSize 2 index viewJPEGgetsize 2 array astore >> setpagedevice viewJPEG"
+% gs -sDEVICE=pdfwrite -o stuff%03d.pdf viewjpeg.ps -c "(image.jpg) << /PageSize 2 index viewJPEGgetsize 2 array astore /HWResolution [ 72 72 ] >> setpagedevice viewJPEG"
% so the output size matches the original image.
/viewJPEGgetsize { % <file|string> ==> width height
save