summaryrefslogtreecommitdiff
path: root/gs/src/gstype2.c
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2000-08-31 02:16:45 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2000-08-31 02:16:45 +0000
commitfbe2f9879ca5fc33e7c9dfd5e43a926dc047cc6d (patch)
tree1fbb9299acf4e2ae7a3ea9a5a840e614e67cabf0 /gs/src/gstype2.c
parent5ea2be5857d38f43a3c742f10f6e41c2ef35f242 (diff)
Fix: Type 2 CharStrings didn't insert an explicit closepath at the end of
each subpath. (This matters for charpath followed by stroke.) git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@680 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gstype2.c')
-rw-r--r--gs/src/gstype2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gs/src/gstype2.c b/gs/src/gstype2.c
index cf845725b..a6e0d58d9 100644
--- a/gs/src/gstype2.c
+++ b/gs/src/gstype2.c
@@ -248,6 +248,14 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_const_string * str,
case cx_vstem:
goto vstem;
case cx_vmoveto:
+ /*
+ * Type 2 CharStrings, unlike Type 1, insert an explicit
+ * closepath before a moveto rather than an implicit one.
+ * (This makes a difference for charpath.)
+ */
+ code = gx_path_close_subpath(sppath);
+ if (code < 0)
+ return code;
check_first_operator(csp > cstack);
accum_y(*csp);
move:if ((pcis->hint_next != 0 || path_is_drawing(sppath)))
@@ -290,6 +298,10 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_const_string * str,
}
goto pp;
case cx_endchar:
+ /* See vmoveto above re closing the subpath. */
+ code = gx_path_close_subpath(sppath);
+ if (code < 0)
+ return code;
/*
* It is an undocumented (!) feature of Type 2 CharStrings
* that if endchar is invoked with 4 or 5 operands, it is
@@ -328,10 +340,18 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_const_string * str,
}
return code;
case cx_rmoveto:
+ /* See vmoveto above re closing the subpath. */
+ code = gx_path_close_subpath(sppath);
+ if (code < 0)
+ return code;
check_first_operator(csp > cstack + 1);
accum_xy(csp[-1], *csp);
goto move;
case cx_hmoveto:
+ /* See vmoveto above re closing the subpath. */
+ code = gx_path_close_subpath(sppath);
+ if (code < 0)
+ return code;
check_first_operator(csp > cstack);
accum_x(*csp);
goto move;