Bug 689014, New glyphs in Helvetica-Bold

Alex Cherepanov <[email protected]> Wed, 11 Jul 2007 08:20:38 -0400
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------080509070705000303030508
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

The 2nd sample file in the bug 689014 uses non-embedded Helvetica-Bold
font and /odblacute glyph. This glyph name doesn't exist in our fonts.

The patch tries to look up alternative glyph names during the glyph
name resolution.

There's an another approach - add the glyph aliases during the font
construction. The former has lower run time costs the latter appears
to be safer when the font is embedded in PDF. What approach
is better ?

/postalias table should be undefined from systemdict but it is now
shared between 2 files. What is a good way to do this ?

--------------080509070705000303030508
Content-Type: text/plain;
 name="689014a.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="689014a.diff"

Index: gs/lib/gs_ttf.ps
===================================================================
--- gs/lib/gs_ttf.ps	(revision 8018)
+++ gs/lib/gs_ttf.ps	(working copy)
@@ -1423,7 +1423,7 @@
   TTFDEBUG { (Encoding: ) print dup === flush } if
 } bind def
 
-currentdict /postalias undef
+% currentdict /postalias undef
 
 % -mark- <key> <value> ... .definettfont <font>
 /.definettfont {
Index: gs/lib/gs_type1.ps
===================================================================
--- gs/lib/gs_type1.ps	(revision 8018)
+++ gs/lib/gs_type1.ps	(working copy)
@@ -113,6 +113,7 @@
 % undefine a dict that is only used internally, and is immediately bound
 currentdict /closesourcedict .undef
 
+
 % Here are the BuildChar and BuildGlyph implementation for Type 1 fonts.
 % The names %Type1BuildChar and %Type1BuildGlyph are known to the interpreter.
 % The real work is done in an operator:
@@ -128,16 +129,25 @@
 /.type1build {		% <font> <code|name> <name> .type1build
 			%   <font> <code|name> <name> <charstring>
   2 index begin
-    dup CharStrings exch .knownget not {
-      2 copy eq { exch pop /.notdef exch } if
-       QUIET not
-	{ (Substituting .notdef for ) print
-	  =string cvs print ( in the font ) print
-	  1 index /FontName get = flush
-	}
-	{ pop }
-       ifelse
-       /.notdef CharStrings /.notdef get
+    dup CharStrings exch .knownget not
+    {                                       % <<>> code name
+      dup postalias exch .knownget {        % <<>> code name name'
+        CharStrings exch .knownget not      % <<>> code name {proc}
+      } {
+        (not found)==
+        //true
+      } ifelse
+      {
+        2 copy eq { exch pop /.notdef exch } if
+         QUIET not
+	  { (Substituting .notdef for ) print
+	    =string cvs print ( in the font ) print
+  	    1 index /FontName get = flush
+	  }
+	  { pop }
+         ifelse
+         /.notdef CharStrings /.notdef get
+      } if
     } if
   end
 } bind def

--------------080509070705000303030508
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review

--------------080509070705000303030508--