diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-02-27 03:11:02 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2012-03-15 11:54:24 +0000 |
commit | 23401e532f394b0fedf41ef97e2673d8a6f35b39 (patch) | |
tree | 15d9008d2e66206e34d16c6d2473a2a52731221f /gs/base/gsstate.c | |
parent | 835bbe29fb0b995e377c010966a80713272d78ba (diff) |
Support HPGL style path handling. (Work in progress)
HPGL handles paths slightly differently to the postscript imaging model.
When a path is filled, successive moveto's are treated as linetos.
(i.e. the 'place we close the path to' is left at the first moveto,
and the area remains fillable). Stroking is unaffected however.
To model this in Ghostscript we add a new path segment type 's_gap'.
The filling code treats this as a lineto. The stroking code is updated
to not stroke such edges (and not to break the subpath at this point).
We add a new parameter to the imager state (hpgl_fill_mode), new
accessor functions (gs_sethpglfillmode, gs_currenthpglfillmode),
and new postscript operators (.sethpglfillmode and .currenthpglfillmode).
If hpgl fill mode is set to a non-zero value, then path construction
treats movetos in an open subpath as gaptos.
Still to do:
* Double check the output from this code matches HPGL.
* Update the clist code to send hpgl fill mode changes.
* Update PDF write to spot such paths and to convert them as
appropriate when writing out.
Diffstat (limited to 'gs/base/gsstate.c')
-rw-r--r-- | gs/base/gsstate.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gs/base/gsstate.c b/gs/base/gsstate.c index 470ca8eea..d279acecd 100644 --- a/gs/base/gsstate.c +++ b/gs/base/gsstate.c @@ -839,6 +839,20 @@ gs_currenttextrenderingmode(const gs_state * pgs) return pgs->text_rendering_mode; } +/* sethpglfillmode */ +void +gs_sethpglfillmode(gs_state * pgs, int fill) +{ + pgs->hpgl_fill_mode = fill; +} + +/* currenthpglfillmode */ +int +gs_currenthpglfillmode(const gs_state * pgs) +{ + return pgs->hpgl_fill_mode; +} + /* ------ Internal routines ------ */ /* Free the privately allocated parts of a gstate. */ |