From 90fa6203ad032fe161d85a3e580941ce3d1216f0 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 8 Feb 2017 13:32:07 +0000 Subject: Add SVG_TEXT_AS_TEXT define. Build with this defined, and we no longer send text as reusable symbols, but instead send it as genuine text, with all the potential problems (mismatching fonts etc) that this entails. Requested by a customer. --- source/fitz/svg-device.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c index 0d01ae64..3db68ada 100644 --- a/source/fitz/svg-device.c +++ b/source/fitz/svg-device.c @@ -1,6 +1,12 @@ #include "fitz-imp.h" #include "glyph-cache-imp.h" +#ifdef SVG_TEXT_AS_TEXT +#define SVG_TEXT_ALPHA(A) A +#else +#define SVG_TEXT_ALPHA(A) 0 +#endif + typedef struct svg_device_s svg_device; typedef struct tile_s tile; @@ -595,14 +601,16 @@ svg_dev_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz for (span = text->head; span; span = span->next) { fz_printf(ctx, out, "head; span; span = span->next) { fnt = svg_dev_text_span_as_paths_defs(ctx, dev, span, ctm); svg_dev_text_span_as_paths_fill(ctx, dev, span, ctm, colorspace, color, alpha, fnt); } +#endif } static void @@ -617,14 +625,16 @@ svg_dev_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const for (span = text->head; span; span = span->next) { fz_printf(ctx, out, "head; span; span = span->next) { fnt = svg_dev_text_span_as_paths_defs(ctx, dev, span, ctm); svg_dev_text_span_as_paths_stroke(ctx, dev, span, stroke, ctm, colorspace, color, alpha, fnt); } +#endif } static void @@ -647,14 +657,16 @@ svg_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz for (span = text->head; span; span = span->next) { fz_printf(ctx, out, "head; span; span = span->next) { fnt = svg_dev_text_span_as_paths_defs(ctx, dev, span, ctm); svg_dev_text_span_as_paths_fill(ctx, dev, span, ctm, fz_device_rgb(ctx), white, 1.0f, fnt); } +#endif fz_printf(ctx, out, "\n"); out = end_def(ctx, sdev); fz_printf(ctx, out, "\n", num); @@ -681,14 +693,16 @@ svg_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c { fz_printf(ctx, out, "head; span; span = span->next) { fnt = svg_dev_text_span_as_paths_defs(ctx, dev, span, ctm); svg_dev_text_span_as_paths_stroke(ctx, dev, span, stroke, ctm, fz_device_rgb(ctx), white, 1.0f, fnt); } +#endif fz_printf(ctx, out, "\n"); out = end_def(ctx, sdev); fz_printf(ctx, out, "\n", num); -- cgit v1.2.3