X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;h=62546db2a3ecfb9cb13062cd7cffc7b5c854bccf;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=41207bfc06dcbae22cddd1da20f2957234018fdf;hpb=922f9285d96ff230c5c6a7017ac7246a0cdf6163;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 41207bf..62546db 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);free(shape2); + } } kerningcount = swf_GetU16(tag); @@ -837,7 +844,9 @@ int cmp_chars(const void*a, const void*b) { int x = *(const int*)a; int y = *(const int*)b; + return 0; } + void swf_FontSort(SWFFONT * font) { int i, j; @@ -1283,6 +1292,13 @@ int swf_TextPrintDefineText(TAG * t, SWFFONT * f) return 0; } +static void font_freealignzones(SWFFONT * f) +{ + if(f->alignzones) + free(f->alignzones); + f->alignzones = 0; +} + void swf_FontFree(SWFFONT * f) { int i; @@ -1318,6 +1334,7 @@ void swf_FontFree(SWFFONT * f) font_freelayout(f); font_freeglyphnames(f); font_freeusage(f); + font_freealignzones(f); rfx_free(f); }