summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2020-12-11 10:55:29 +0000
committerChris Liddell <chris.liddell@artifex.com>2020-12-15 10:26:28 +0000
commit87eed438b0cffba111371c25e1d169163f310465 (patch)
tree6cca58789bfb177e79b2d4525529ef4228b1888c
parentbcd9f9d0126d07dc6f93e47618baa6d23fcaf1c2 (diff)
downloadghostpdl-87eed438b0cffba111371c25e1d169163f310465.tar.gz
Reintroduce and update cff std strings "encoding" PS file
and move it to "lib" since we don't actually use it in Postscript any more. It's only used if we ever need to regenerate the C representation of "known encodings". Also, update to include missing strings. Finally, fix the tool that relies on this "encoding" - .namestring is no longer exposed as a Postscript operator, so define a local equivalent. And update the example invocation in the comments
-rw-r--r--lib/gs_css_e.ps117
-rw-r--r--toolbin/encs2c.ps19
2 files changed, 132 insertions, 4 deletions
diff --git a/lib/gs_css_e.ps b/lib/gs_css_e.ps
new file mode 100644
index 000000000..4542a2c1b
--- /dev/null
+++ b/lib/gs_css_e.ps
@@ -0,0 +1,117 @@
+% Copyright (C) 2001-2012 Artifex Software, Inc.
+% All Rights Reserved.
+%
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+%
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+%
+% Refer to licensing information at http://www.artifex.com or contact
+% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+% CA 94903, U.S.A., +1(415)492-9861, for further information.
+%
+
+% Define the CFF StandardStrings that represent characters.
+% This is a pseudo-encoding.
+/currentglobal where
+ { pop currentglobal { setglobal } //true setglobal }
+ { { } }
+ifelse
+/CFFStandardStrings mark
+
+% 0
+ /.notdef /space /exclam /quotedbl /numbersign
+ /dollar /percent /ampersand /quoteright /parenleft
+ /parenright /asterisk /plus /comma /hyphen
+ /period /slash /zero /one /two
+ /three /four /five /six /seven
+ /eight /nine /colon /semicolon /less
+ /equal /greater /question /at /A
+ /B /C /D /E /F
+ /G /H /I /J /K
+ /L /M /N /O /P
+% 50
+ /Q /R /S /T /U
+ /V /W /X /Y /Z
+ /bracketleft /backslash /bracketright /asciicircum /underscore
+ /quoteleft /a /b /c /d
+ /e /f /g /h /i
+ /j /k /l /m /n
+ /o /p /q /r /s
+ /t /u /v /w /x
+ /y /z /braceleft /bar /braceright
+ /asciitilde /exclamdown /cent /sterling /fraction
+% 100
+ /yen /florin /section /currency /quotesingle
+ /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi
+ /fl /endash /dagger /daggerdbl /periodcentered
+ /paragraph /bullet /quotesinglbase /quotedblbase /quotedblright
+ /guillemotright /ellipsis /perthousand /questiondown /grave
+ /acute /circumflex /tilde /macron /breve
+ /dotaccent /dieresis /ring /cedilla /hungarumlaut
+ /ogonek /caron /emdash /AE /ordfeminine
+ /Lslash /Oslash /OE /ordmasculine /ae
+ /dotlessi /lslash /oslash /oe /germandbls
+% 150
+ /onesuperior /logicalnot /mu /trademark /Eth
+ /onehalf /plusminus /Thorn /onequarter /divide
+ /brokenbar /degree /thorn /threequarters /twosuperior
+ /registered /minus /eth /multiply /threesuperior
+ /copyright /Aacute /Acircumflex /Adieresis /Agrave
+ /Aring /Atilde /Ccedilla /Eacute /Ecircumflex
+ /Edieresis /Egrave /Iacute /Icircumflex /Idieresis
+ /Igrave /Ntilde /Oacute /Ocircumflex /Odieresis
+ /Ograve /Otilde /Scaron /Uacute /Ucircumflex
+ /Udieresis /Ugrave /Yacute /Ydieresis /Zcaron
+% 200
+ /aacute /acircumflex /adieresis /agrave /aring
+ /atilde /ccedilla /eacute /ecircumflex /edieresis
+ /egrave /iacute /icircumflex /idieresis /igrave
+ /ntilde /oacute /ocircumflex /odieresis /ograve
+ /otilde /scaron /uacute /ucircumflex /udieresis
+ /ugrave /yacute /ydieresis /zcaron /exclamsmall
+ /Hungarumlautsmall /dollaroldstyle /dollarsuperior /ampersandsmall /Acutesmall
+ /parenleftsuperior /parenrightsuperior /twodotenleader /onedotenleader /zerooldstyle
+ /oneoldstyle /twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle
+ /sixoldstyle /sevenoldstyle /eightoldstyle /nineoldstyle /commasuperior
+% 250
+ /threequartersemdash /periodsuperior /questionsmall /asuperior /bsuperior
+ /centsuperior /dsuperior /esuperior /isuperior /lsuperior
+ /msuperior /nsuperior /osuperior /rsuperior /ssuperior
+ /tsuperior /ff /ffi /ffl /parenleftinferior
+ /parenrightinferior /Circumflexsmall /hyphensuperior /Gravesmall /Asmall
+ /Bsmall /Csmall /Dsmall /Esmall /Fsmall
+ /Gsmall /Hsmall /Ismall /Jsmall /Ksmall
+ /Lsmall /Msmall /Nsmall /Osmall /Psmall
+ /Qsmall /Rsmall /Ssmall /Tsmall /Usmall
+ /Vsmall /Wsmall /Xsmall /Ysmall /Zsmall
+% 300
+ /colonmonetary /onefitted /rupiah /Tildesmall /exclamdownsmall
+ /centoldstyle /Lslashsmall /Scaronsmall /Zcaronsmall /Dieresissmall
+ /Brevesmall /Caronsmall /Dotaccentsmall /Macronsmall /figuredash
+ /hypheninferior /Ogoneksmall /Ringsmall /Cedillasmall /questiondownsmall
+ /oneeighth /threeeighths /fiveeighths /seveneighths /onethird
+ /twothirds /zerosuperior /foursuperior /fivesuperior /sixsuperior
+ /sevensuperior /eightsuperior /ninesuperior /zeroinferior /oneinferior
+ /twoinferior /threeinferior /fourinferior /fiveinferior /sixinferior
+ /seveninferior /eightinferior /nineinferior /centinferior /dollarinferior
+ /periodinferior /commainferior /Agravesmall /Aacutesmall /Acircumflexsmall
+% 350
+ /Atildesmall /Adieresissmall /Aringsmall /AEsmall /Ccedillasmall
+ /Egravesmall /Eacutesmall /Ecircumflexsmall /Edieresissmall /Igravesmall
+ /Iacutesmall /Icircumflexsmall /Idieresissmall /Ethsmall /Ntildesmall
+ /Ogravesmall /Oacutesmall /Ocircumflexsmall /Otildesmall /Odieresissmall
+ /OEsmall /Oslashsmall /Ugravesmall /Uacutesmall /Ucircumflexsmall
+ /Udieresissmall /Yacutesmall /Thornsmall /Ydieresissmall
+% 379
+ /001.000 /001.001 /001.002 /001.003
+ /Black /Bold /Book /Light /Medium
+ /Regular /Roman /Semibold
+%391 = end
+
+counttomark packedarray exch pop
+10 1 index .registerencoding
+.defineencoding
+exec
diff --git a/toolbin/encs2c.ps b/toolbin/encs2c.ps
index f734b603d..6d8b050ca 100644
--- a/toolbin/encs2c.ps
+++ b/toolbin/encs2c.ps
@@ -22,8 +22,8 @@
% represent them in a compact format described in src/gscencs.c.
% The generated files are named gscedata.[ch] and are included in the
% source distribution in the src directory. The canonical invocation is
-% gs -dNODISPLAY -q -SO=gscedata.h toolbin/encs2c.ps > src/gscedata.h
-% gs -dNODISPLAY -q -SO=gscedata.c toolbin/encs2c.ps > src/gscedata.c
+% gs -dNOSAFER -Ilib -dNODISPLAY -q -SO=gscedata.h toolbin/encs2c.ps > src/gscedata.h
+% gs -dNOSAFER -Ilib -dNODISPLAY -q -SO=gscedata.c toolbin/encs2c.ps > src/gscedata.c
%
% NOTE: If the C representation of encodings changes, this file
% (toolbin/encs2c.ps), src/gscencs.h, and src/gscencs.c must be kept
@@ -33,8 +33,19 @@
% WinAnsiEncoding, StandardEncoding, MacExpertEncoding, SymbolEncoding
% for pdfwrite device.
%
-% gs -dNODISPLAY -q -SO=gdevpdtv.h toolbin/encs2c.ps > src/gdevpdtv.h
-% gs -dNODISPLAY -q -SO=gdevpdtv.c toolbin/encs2c.ps > src/gdevpdtv.c
+% gs -dNOSAFER -Ilib -dNODISPLAY -q -SO=gdevpdtv.h toolbin/encs2c.ps > src/gdevpdtv.h
+% gs -dNOSAFER -Ilib -dNODISPLAY -q -SO=gdevpdtv.c toolbin/encs2c.ps > src/gdevpdtv.c
+%
+% For "-Ilib" you need to point that at a valid "lib" directory from
+% the ghostpdl tree - since gs_css_e.ps now lives there.
+
+% .namestring is longer available as an operator, define an
+% equivalent here
+/.namestring
+{
+ dup length string cvs
+} bind def
+
% ================ Write header file ================ %