[cairo-commit] src/cairo-type1-subset.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Thu Apr 5 16:49:09 PDT 2012


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

New commits:
commit 70b2856ed3d31b41e69b3d82fb9c5c11c2b3d3d4
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Apr 6 09:13:35 2012 +0930

    type1-subset: use fallback font if glyph widths are calculated
    
    Bug 48349 has a pdf file with a Type 1 font where the glyph widths are
    of the form:
    
    34 9302 19 div hsbw

diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 607ac8e..ba1008a 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -751,6 +751,9 @@ cairo_type1_font_subset_parse_charstring (cairo_type1_font_subset_t *font,
 	    command = *p++;
 	    switch (command) {
 		case TYPE1_CHARSTRING_COMMAND_HSBW:
+		     if (! last_op_was_integer)
+			  return CAIRO_INT_STATUS_UNSUPPORTED;
+
 		    font->glyphs[glyph].width = font->build_stack.stack[1]/font->base.units_per_em;
 		    font->build_stack.sp = 0;
 		    last_op_was_integer = FALSE;
@@ -797,6 +800,9 @@ cairo_type1_font_subset_parse_charstring (cairo_type1_font_subset_t *font,
 			    break;
 
 			case TYPE1_CHARSTRING_COMMAND_SBW:
+			     if (! last_op_was_integer)
+				  return CAIRO_INT_STATUS_UNSUPPORTED;
+
 			    font->glyphs[glyph].width = font->build_stack.stack[2]/font->base.units_per_em;
 			    font->build_stack.sp = 0;
 			    last_op_was_integer = FALSE;


More information about the cairo-commit mailing list