summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-11-05 17:49:09 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-11-07 14:02:18 +0100
commit164ddc22ee0d5b63a81d5148f44c37dd132a9356 (patch)
tree031b1ff14c6317d256ff877a89ae93e8c9295c37 /source
parent244a960a509ce4b8476f0ad9e3e3d1cd4bc381d6 (diff)
downloadmupdf-164ddc22ee0d5b63a81d5148f44c37dd132a9356.tar.xz
Fix 700043: Don't assume a font is t3 just because fz_outline_glyph fails.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/svg-device.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index 2876a89b..aaf53b99 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -472,27 +472,28 @@ svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *s
/* Need to send this one */
fz_rect rect;
fz_path *path;
- path = fz_outline_glyph(ctx, span->font, gid, fz_identity);
- if (path)
+ out = start_def(ctx, sdev);
+ fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid);
+ if (fz_font_ft_face(ctx, span->font))
{
- rect = fz_bound_path(ctx, path, NULL, fz_identity);
- shift.e = -rect.x0;
- shift.f = -rect.y0;
- fz_transform_path(ctx, path, shift);
- out = start_def(ctx, sdev);
- fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid);
- fz_write_printf(ctx, out, "<path");
- svg_dev_path(ctx, sdev, path);
- fz_write_printf(ctx, out, "/>\n");
- fz_drop_path(ctx, path);
+ path = fz_outline_glyph(ctx, span->font, gid, fz_identity);
+ if (path)
+ {
+ rect = fz_bound_path(ctx, path, NULL, fz_identity);
+ shift.e = -rect.x0;
+ shift.f = -rect.y0;
+ fz_transform_path(ctx, path, shift);
+ fz_write_printf(ctx, out, "<path");
+ svg_dev_path(ctx, sdev, path);
+ fz_write_printf(ctx, out, "/>\n");
+ fz_drop_path(ctx, path);
+ }
}
- else
+ else if (fz_font_t3_procs(ctx, span->font))
{
rect = fz_bound_glyph(ctx, span->font, gid, fz_identity);
shift.e = -rect.x0;
shift.f = -rect.y0;
- out = start_def(ctx, sdev);
- fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid);
fz_run_t3_glyph(ctx, span->font, gid, shift, dev);
}
fz_write_printf(ctx, out, "</symbol>\n");