diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-10-09 13:59:51 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-10-09 14:54:52 +0100 |
commit | 4338ecbcb672f5b7bc988980c7dc0232efe625d0 (patch) | |
tree | f2cc93766038bc4e57783bcba0f894910134b507 /source/fitz/font.c | |
parent | 9ea6ca1c95f5dbfd4db20369618f095ded634027 (diff) | |
download | mupdf-4338ecbcb672f5b7bc988980c7dc0232efe625d0.tar.xz |
SVG: Support Type3 fonts and stroked fonts.
Diffstat (limited to 'source/fitz/font.c')
-rw-r--r-- | source/fitz/font.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index 334f076a..06ecab76 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -1020,11 +1020,24 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, return bounds; } +void +fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_device *dev) +{ + fz_display_list *list; + fz_matrix ctm; + + list = font->t3lists[gid]; + if (!list) + return; + + fz_concat(&ctm, &font->t3matrix, trm); + fz_run_display_list(list, dev, &ctm, &fz_infinite_rect, NULL); +} + fz_pixmap * fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor) { fz_display_list *list; - fz_matrix ctm; fz_rect bounds; fz_irect bbox; fz_device *dev; @@ -1062,10 +1075,19 @@ fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matr glyph = fz_new_pixmap_with_bbox(ctx, model ? model : fz_device_gray(ctx), &bbox); fz_clear_pixmap(ctx, glyph); - fz_concat(&ctm, &font->t3matrix, trm); dev = fz_new_draw_device_type3(ctx, glyph); - fz_run_display_list(list, dev, &ctm, &fz_infinite_rect, NULL); - fz_free_device(dev); + fz_try(ctx) + { + fz_run_t3_glyph(ctx, font, gid, trm, dev); + } + fz_always(ctx) + { + fz_free_device(dev); + } + fz_catch(ctx) + { + fz_rethrow(ctx); + } if (!model) { |