[poppler] poppler/fofi: FoFiType1.cc,1.1.1.1,1.2

Jeff Muizelaar jrmuizel at freedesktop.org
Sat Apr 30 10:31:49 PDT 2005


Update of /cvs/poppler/poppler/fofi
In directory gabe:/tmp/cvs-serv19950/fofi

Modified Files:
	FoFiType1.cc 
Log Message:

2005-04-30  Jeff Muizelaar  <jeff at infidigm.net>

	* fofi/FoFiType1.cc (FoFiType1::parse):
	Don't assume Encoding array of Type1 fonts end in "foo def".
	http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF says
	"This sequence of assignments must be followed by an instance of the
	token def or readonly; such a token may not occur within the sequence
	of assignments." so it must end with "readonly" "def" "readonly def"
	(That is what most fonts are using and this is why it was not
	crashing)

	Patch from Albert Astals Cid.


Index: FoFiType1.cc
===================================================================
RCS file: /cvs/poppler/poppler/fofi/FoFiType1.cc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- FoFiType1.cc	3 Mar 2005 19:45:58 -0000	1.1.1.1
+++ FoFiType1.cc	30 Apr 2005 17:31:47 -0000	1.2
@@ -187,9 +187,17 @@
 	    }
 	  }
 	} else {
-	  if (strtok(buf, " \t") &&
-	      (p = strtok(NULL, " \t\n\r")) && !strcmp(p, "def")) {
-	    break;
+	  p = strtok(buf, " \t\n\r");
+	  if (p) {
+	    if (!strcmp(p, "def"))
+	      break;
+	    if (!strcmp(p, "readonly"))
+	      break;
+	    /* the spec does not says this but i'm mantaining old xpdf behaviour
+	     * that accepts "foo def" as end of the encoding array */
+	    p = strtok(NULL, " \t\n\r");
+	    if (p && !strcmp(p, "def"))
+	      break;
 	  }
 	}
 	line = line1;



More information about the poppler mailing list