X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;fp=lib%2Fmodules%2Fswftext.c;h=bc0ff4f1ef48ad7a4a7a833ee1dbd70aa8c256b8;hb=97dad4c442ac9a74c5941e57023a9e2995fe81e9;hp=41207bfc06dcbae22cddd1da20f2957234018fdf;hpb=a61b92b4ac72cd15ee0f3165f2e7a2f5ac00f156;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 41207bf..bc0ff4f 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -349,6 +349,13 @@ int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag) for (t = 0; t < glyphcount; t++) { swf_ResetReadBits(tag); swf_GetRect(tag, &font->layout->bounds[t]); + SRECT b = font->layout->bounds[t]; + if((b.xmin|b.xmax|b.ymin|b.ymax) == 0) { + // recalculate bounding box + SHAPE2 *shape2 = swf_ShapeToShape2(font->glyph[t].shape); + font->layout->bounds[t] = swf_GetShapeBoundingBox(shape2); + swf_Shape2Free(shape2); + } } kerningcount = swf_GetU16(tag);