[cairo-commit] 2 commits - src/cairo-pdf-surface.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Dec 1 09:01:27 UTC 2023
src/cairo-pdf-surface.c | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit ee07a8118527fd1b672c3de6a2ae3b4607487737
Merge: f9358f26b 10fffac83
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Fri Dec 1 09:01:24 2023 +0000
Merge branch 'pdf-userfont-stroke' into 'master'
[pdf] Set both fill and stroke colors in show_text_glyphs
Closes #813
See merge request cairo/cairo!527
commit 10fffac83c576f5aeba7d804e39470b4a88b79dc
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Nov 30 15:51:03 2023 -0500
[pdf] Set both fill and stroke colors in show_text_glyphs
Since a user-font might be calling stroke, and PDF has separate
stroke and fill colors.
Note that this bug was not exposed in Poppler. It's probably a
bug there. But multiple other viewers expoed this bug.
Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/813
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 50f4daa57..713880703 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -52,6 +52,7 @@
#include "cairo-composite-rectangles-private.h"
#include "cairo-default-context-private.h"
#include "cairo-error-private.h"
+#include "cairo-user-font-private.h"
#include "cairo-image-surface-inline.h"
#include "cairo-image-info-private.h"
#include "cairo-recording-surface-inline.h"
@@ -9297,6 +9298,13 @@ _cairo_pdf_surface_show_text_glyphs (void *abstract_surface,
if (unlikely (status))
goto cleanup;
+ /* User-fonts can use strokes; reset the stroke pattern as well. */
+ if (_cairo_font_face_is_user(scaled_font->font_face)) {
+ status = _cairo_pdf_surface_select_pattern (surface, source, pattern_res, TRUE);
+ if (unlikely (status))
+ goto cleanup;
+ }
+
/* Each call to show_glyphs() with a transclucent pattern must
* be in a separate text object otherwise overlapping text
* from separate calls to show_glyphs will not composite with
More information about the cairo-commit
mailing list