[PATCH] type1-subset: always include subroutine 4 (hint replacement idiom)

David Maxwell <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
This patch is an update to commit 0d5f637 that addressed Flex/ hint replacement subroutines and type 1 font subsetting.  The previous commit ensured that subroutines 0 to 3 were always included in a subsetted  type 1 font.  If these subroutines are absent, the cgpdftops CUPS filter on OS X crashes.  It turns out that subroutine 4, although not part of the official Type 1 spec for  Flex/ hint replacement, is idiomatically used along with subroutines 0-3.  If subroutine 4 is absent,  cgpdftops crashes similarly.  I missed this case in testing because subroutine 4 was coincidentally already being included in the test cases.

David Maxwell
Associate Professor 
Department of Mathematics and Statistics
University of Alaska Fairbanks  

From 0aece347ba951ca966ef902dc67374e6d9a757ed Mon Sep 17 00:00:00 2001
From: David Maxwell <[email protected]>
Date: Thu, 11 Oct 2012 08:52:36 -0800
Subject: [PATCH] type1-subset: always include subroutine 4 (hint replacement
 idiom)

---
 src/cairo-type1-subset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index d177fa9..e87ed46 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -1399,9 +1399,9 @@ skip_subrs:
 	    return status;
     }
 
-    /* Always include the first four subroutines in case the Flex/hint mechanism is
+    /* Always include the first five subroutines in case the Flex/hint mechanism is
      * being used. */
-    for (j = 0; j < MIN(font->num_subrs, 4); j++) {
+    for (j = 0; j < MIN (font->num_subrs, 5); j++) {
 	font->subrs[j].used = TRUE;
     }
 
-- 
1.7.11.1


-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.