summaryrefslogtreecommitdiff
path: root/src/cairo-ps-surface.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-07-23 19:10:55 +0930
committerAdrian Johnson <ajohnson@redneon.com>2021-07-23 19:10:55 +0930
commit0f18a873ef21107a3c5c5bea5ea57d544da74d5a (patch)
tree9a317acddf7de3629b57cb2afb47feb0e52294ff /src/cairo-ps-surface.c
parente5e63a04623db06a3b96883ea2f8849457ad35f5 (diff)
downloadcairo-0f18a873ef21107a3c5c5bea5ea57d544da74d5a.tar.gz
PS: ensure setup DSC comments are in BeginSetup section
Fixes #411
Diffstat (limited to 'src/cairo-ps-surface.c')
-rw-r--r--src/cairo-ps-surface.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index fb2696ea6..0e7b77059 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -497,17 +497,6 @@ _cairo_ps_surface_emit_header (cairo_ps_surface_t *surface)
_cairo_output_stream_printf (surface->final_stream,
"%%%%EndProlog\n");
-
- num_comments = _cairo_array_num_elements (&surface->dsc_setup_comments);
- if (num_comments) {
- comments = _cairo_array_index (&surface->dsc_setup_comments, 0);
- for (i = 0; i < num_comments; i++) {
- _cairo_output_stream_printf (surface->final_stream,
- "%s\n", comments[i]);
- free (comments[i]);
- comments[i] = NULL;
- }
- }
}
static cairo_status_t
@@ -1764,6 +1753,17 @@ _cairo_ps_surface_finish (void *abstract_surface)
_cairo_output_stream_printf (surface->final_stream,
"%%%%BeginSetup\n");
+ num_comments = _cairo_array_num_elements (&surface->dsc_setup_comments);
+ if (num_comments) {
+ comments = _cairo_array_index (&surface->dsc_setup_comments, 0);
+ for (i = 0; i < num_comments; i++) {
+ _cairo_output_stream_printf (surface->final_stream,
+ "%s\n", comments[i]);
+ free (comments[i]);
+ comments[i] = NULL;
+ }
+ }
+
status = _cairo_ps_surface_emit_font_subsets (surface);
if (unlikely (status))
goto CLEANUP;