[gs-commits] mupdf 1.16.1.6 Use round caps/joins when generating ink a

[email protected] (Sebastian Rasmussen)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit b11dc2b6550eb673b5a858b49d881aadf0ebfcea
Author: Sebastian Rasmussen <[email protected]>
Date:   Thu Aug 15 14:42:18 2019 +0200

    Use round caps/joins when generating ink annotation appearances.
    
    This makes ink annotations look less jagged and allows for
    degenerate annotations with a single point to be visible.
    
    Make sure that generated appearance streams for single point
    ink annotation contain a moveto operator and a lineto operator.
    This means that when the path is stroked it will look like a dot.

diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c
index 8517080..acab03a 100644
--- a/source/pdf/pdf-appearance.c
+++ b/source/pdf/pdf-appearance.c
@@ -381,6 +381,8 @@ pdf_write_ink_appearance(fz_context *ctx, pdf_annot *annot, fz_buffer *buf, fz_r
 
 	*rect = fz_empty_rect;
 
+	fz_append_printf(ctx, buf, "1 J\n1 j\n");
+
 	ink_list = pdf_dict_get(ctx, annot->obj, PDF_NAME(InkList));
 	n = pdf_array_len(ctx, ink_list);
 	for (i = 0; i < n; ++i)
@@ -400,6 +402,9 @@ pdf_write_ink_appearance(fz_context *ctx, pdf_annot *annot, fz_buffer *buf, fz_r
 				*rect = fz_include_point_in_rect(*rect, p);
 			fz_append_printf(ctx, buf, "%g %g %c\n", p.x, p.y, k == 0 ? 'm' : 'l');
 		}
+
+		if (m == 1)
+			fz_append_printf(ctx, buf, "%g %g %c\n", p.x, p.y, 'l');
 	}
 	fz_append_printf(ctx, buf, "S");
 	*rect = fz_expand_rect(*rect, lw);

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=b11dc2b6550eb673b5a858b49d881aadf0ebfcea

--
MuPDF library
Artifex Software, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.