summaryrefslogtreecommitdiff
path: root/fitz/res_font.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-04-15 22:40:41 +0200
committerTor Andersson <tor@ghostscript.com>2010-04-15 22:40:41 +0200
commit80f493b34eb72dfad76d06a97545e64afff84f78 (patch)
treee048b299da91aba52b878eab6242780f9f896bfc /fitz/res_font.c
parentbd7e94651b00d884ffb0a5349182d99a87396a6d (diff)
downloadmupdf-80f493b34eb72dfad76d06a97545e64afff84f78.tar.xz
Make the glyph cache an input to fz_newdrawdevice so that it can be shared between pages.
Diffstat (limited to 'fitz/res_font.c')
-rw-r--r--fitz/res_font.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c
index b7cc6cda..22e380cc 100644
--- a/fitz/res_font.c
+++ b/fitz/res_font.c
@@ -361,6 +361,7 @@ fz_rendert3glyph(fz_glyph *glyph, fz_font *font, int gid, fz_matrix trm)
fz_buffer *contents;
fz_rect bbox;
fz_device *dev;
+ fz_glyphcache *cache;
glyph->x = 0;
glyph->y = 0;
@@ -388,12 +389,14 @@ fz_rendert3glyph(fz_glyph *glyph, fz_font *font, int gid, fz_matrix trm)
pixmap = fz_newpixmap(nil, bbox.x0, bbox.y0, bbox.x1 - bbox.x0, bbox.y1 - bbox.y0);
fz_clearpixmap(pixmap, 0x00);
- dev = fz_newdrawdevice(pixmap);
+ cache = fz_newglyphcache(512, 512*512);
+ dev = fz_newdrawdevice(cache, pixmap);
contents->rp = contents->bp;
error = font->t3runcontentstream(dev, ctm, font->t3xref, font->t3resources, contents);
if (error)
fz_catch(error, "cannot draw type3 glyph");
fz_freedevice(dev);
+ fz_freeglyphcache(cache);
glyph->x = pixmap->x;
glyph->y = pixmap->y;