X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;h=ddfd76182ba63f48fefd6f4cb9dec4d81bfc74da;hb=63d4c6916a33874f65d1fc6e5244611adb413c74;hp=ee3923ea15dfa1084f7f5ca75c43aa8873945eb7;hpb=644837a3d0f18ac76d55c9ba438246cb5a2927d6;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index ee3923e..ddfd761 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -310,7 +310,8 @@ int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag) swf_GetSimpleShape(tag, &(font->glyph[t].shape)); } - swf_SetTagPos(tag, offset[glyphcount]+offset_start); + if(glyphcount) + swf_SetTagPos(tag, offset[glyphcount]+offset_start); free(offset); @@ -801,6 +802,7 @@ int swf_FontInitUsage(SWFFONT * f) f->use->is_reduced = 0; f->use->used_glyphs = 0; f->use->chars = (int*)rfx_calloc(sizeof(f->use->chars[0]) * f->numchars); + f->use->glyphs_specified = 0; return 0; } @@ -942,10 +944,11 @@ int swf_FontSetDefine2(TAG * tag, SWFFONT * f) swf_SetU8(tag, 0); //reserved flags if (f->name) { /* font name */ - swf_SetU8(tag, strlen((const char*)f->name)); - swf_SetBlock(tag, f->name, strlen((const char*)f->name)); + swf_SetU8(tag, strlen((const char*)f->name)+1); + swf_SetBlock(tag, f->name, strlen((const char*)f->name)+1); } else { /* font name (="") */ + swf_SetU8(tag, 1); swf_SetU8(tag, 0); } /* number of glyphs */