X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;h=28ebc150f043d10f68a2668cec17b9e2fefb2d49;hb=8a7edac805dc411753186e189ddc3781265920d8;hp=e5901cb146997579e0da21f13aee042137655c82;hpb=8ff8aea6d9d76a443ab2391671af79e91f780bbc;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index e5901cb..28ebc15 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -80,7 +80,7 @@ int swf_FontExtract_DefineFont(int id,SWFFONT * f,TAG * t) fid = swf_GetU16(t); if ((!id)||(id==fid)) - { U16 of,*ofs; + { U16 of; int n,i; id = fid; @@ -208,11 +208,15 @@ int swf_FontExtract_DefineFont2(int id,SWFFONT * font,TAG * tag) if(flags1&8) { // wide offsets for(t=0;tglyph[t].shape)); @@ -254,8 +258,10 @@ int swf_FontExtract_DefineFont2(int id,SWFFONT * font,TAG * tag) swf_ResetReadBits(tag); swf_GetRect(tag, font->layout->bounds); } + kerningcount = swf_GetU16(tag); font->layout->kerningcount = kerningcount; + font->layout->kerning = (SWFKERNING*)malloc(sizeof(SWFKERNING)*kerningcount); if(kerningcount) { font->layout->kerning = @@ -392,7 +398,7 @@ int swf_FontExtract(SWF * swf,int id,SWFFONT * * font) int swf_FontSetID(SWFFONT * f,U16 id) { if (!f) return -1; f->id = id; return 0; } int swf_FontReduce(SWFFONT * f,FONTUSAGE * use) -{ int i,j,num; +{ int i,j; if ((!f)||(!use)) return -1; j = 0; @@ -927,7 +933,8 @@ void swf_WriteFont(SWFFONT*font, char* filename) rgb.b = 0x00; for(y=0;y<=((font->maxascii-1)/16);y++) { - int c=0,lastx=-1, firstx=0; + int c=0,lastx=-1; + /* TODO: firstx?? */ for(x=0;x<16;x++) { int g = (y*16+xmaxascii)?font->ascii2glyph[y*16+x]:-1; if(g>=0 && font->glyph[g].shape) {