diff options
Diffstat (limited to 'fitz/res_font.c')
-rw-r--r-- | fitz/res_font.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c index 90321523..145acea1 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -352,7 +352,7 @@ fz_rendert3glyph(fz_font *font, int gid, fz_matrix trm) fz_error error; fz_matrix ctm; fz_buffer *contents; - fz_rect bbox; + fz_bbox bbox; fz_device *dev; fz_glyphcache *cache; fz_pixmap *glyph; @@ -365,11 +365,12 @@ fz_rendert3glyph(fz_font *font, int gid, fz_matrix trm) return NULL; ctm = fz_concat(font->t3matrix, trm); - bbox = fz_transformrect(ctm, font->bbox); - bbox.x0 = floor(bbox.x0); - bbox.y0 = floor(bbox.y0); - bbox.x1 = ceil(bbox.x1); - bbox.y1 = ceil(bbox.y1); + dev = fz_newbboxdevice(&bbox); + error = font->t3runcontentstream(dev, ctm, font->t3xref, font->t3resources, contents); + if (error) + fz_catch(error, "cannot draw type3 glyph"); + fz_freedevice(dev); + glyph = fz_newpixmap(nil, bbox.x0, bbox.y0, bbox.x1 - bbox.x0, bbox.y1 - bbox.y0); fz_clearpixmap(glyph, 0x00); |