summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2012-04-06 09:13:35 +0930
committerAdrian Johnson <ajohnson@redneon.com>2012-04-06 09:13:35 +0930
commit70b2856ed3d31b41e69b3d82fb9c5c11c2b3d3d4 (patch)
treefc70fbec9c840333041c4902b94f4112da4ddeb7
parent7a262fd398c8a1f3c9052e8d9ec459e27ff91b4d (diff)
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
-rw-r--r--src/cairo-type1-subset.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 607ac8e46..ba1008a14 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;