[gs-cvs] gs/lib

Ray Johnston ray at ghostscript.com
Wed Jul 20 07:46:18 PDT 2005


Update of /cvs/ghostscript/gs/lib
In directory casper2:/tmp/cvs-serv12958/lib

Modified Files:
	gs_ttf.ps 
Log Message:
Fix undefined in -get- caused by previous (1.38) patch that ignored zero
length tables in TT font. Previous fix for 687457. Bug 688220 for customer
580.

DETAILS:

Some tables, such as 'glyf' are required by the ttf code even if they are
zero length. The 687457 bug omitted these tables since their position is
arbitrary, but they could cause false 'overlap' conditions, potentially
truncating a non-zero length table to zero length. The simplest solution
is to place all zero length tables at offset 0 (the offset is arbitrary
for zero length tables).

EXPECTED DIFFERENCES:

Regression testing showed no problems. The file for 687457 is now added
to the regression suite as will a test file with a zero length 'glyf'.


Index: gs_ttf.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/gs_ttf.ps,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- gs_ttf.ps	13 Jul 2005 18:18:07 -0000	1.44
+++ gs_ttf.ps	20 Jul 2005 14:46:16 -0000	1.45
@@ -590,7 +590,7 @@
 % <file> <bool> <SubfontID> .loadttfonttables -
 % Pushes .loadttfontdict & scratch dict on d-stack.
 % Defines f, offsets, tables, tabdict, tabs.
-% Skips loca nd glyf if <bool> is true.
+% Skips loca and glyf if <bool> is true.
 /.loadttfonttables {
   .loadttfontdict begin
   40 dict begin
@@ -626,11 +626,9 @@
     tables exch 16 getinterval
     TTFDEBUG { dup .printtab } if
     dup 0 4 getinterval readtables_ 1 index known {
-      1 index 12 4 getinterval (\0\0\0\0) eq {
-        pop pop    % Ignore zero-length table
-      } {
-        tabdict exch 2 index put
-      } ifelse
+      % put all 0 length tables at 0 to avoid overlap
+      1 index 12 getu32 0 eq { 1 index 8 0 putu32 } if
+      tabdict exch 2 index put
     } {
       pop pop
     } ifelse



More information about the gs-cvs mailing list