X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fdevices%2Frecord.c;h=4cc75dde0beb8134fa3dac50c43bcef8b60e48dc;hb=0db3611587fda836716b21724df956815ab784db;hp=f0b70f6e6271c8439b7323aa2d9969d4e7637b93;hpb=018b4ff4529ff084c6c551fa40ff1c2a8be32741;p=swftools.git diff --git a/lib/devices/record.c b/lib/devices/record.c index f0b70f6..4cc75dd 100644 --- a/lib/devices/record.c +++ b/lib/devices/record.c @@ -241,6 +241,8 @@ static void dumpFont(writer_t*w, gfxfont_t*font) writer_writeString(w, font->id); writer_writeU32(w, font->num_glyphs); writer_writeU32(w, font->max_unicode); + writer_writeDouble(w, font->ascent); + writer_writeDouble(w, font->descent); int t; for(t=0;tnum_glyphs;t++) { dumpLine(w, font->glyphs[t].line); @@ -262,6 +264,8 @@ static gfxfont_t*readFont(reader_t*r) font->id = reader_readString(r); font->num_glyphs = reader_readU32(r); font->max_unicode = reader_readU32(r); + font->ascent = reader_readDouble(r); + font->descent = reader_readDouble(r); font->glyphs = (gfxglyph_t*)rfx_calloc(sizeof(gfxglyph_t)*font->num_glyphs); font->unicode2glyph = (int*)rfx_calloc(sizeof(font->unicode2glyph[0])*font->max_unicode); int t; @@ -549,7 +553,11 @@ static void replay(struct _gfxdevice*dev, gfxdevice_t*out, void*data, int length } finish: r->dealloc(r); - gfxfontlist_free(fontlist, 1); + /* problem: if we just replayed into a device which stores the + font for later use (the record device itself is a nice example), + then we can't free it yet */ + //gfxfontlist_free(fontlist, 1); + gfxfontlist_free(fontlist, 0); } void gfxresult_record_replay(gfxresult_t*result, gfxdevice_t*device) {