X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=inline;f=lib%2Fmodules%2Fswftext.c;h=1e8e7e6a4cfbe3dbc954cb7e17f71dbaccc17185;hb=3976e328daac108e462695657b52e0137250cb2f;hp=3d6a49be8f9da61e988e868d9ab0f8b6758c887a;hpb=5b7eb774b61e53673dfbbf715a9df08cb9e00e8b;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 3d6a49b..1e8e7e6 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -927,7 +927,7 @@ void swf_WriteFont(SWFFONT*font, char* filename) { int c; t = swf_InsertTag(t,ST_GLYPHNAMES); - swf_SetU16(t, font->id); + swf_SetU16(t, WRITEFONTID); swf_SetU16(t, font->numchars); for(c=0;cnumchars;c++) { swf_SetString(t, font->glyphnames[c]); @@ -943,9 +943,14 @@ void swf_WriteFont(SWFFONT*font, char* filename) int ypos = 1; U8 gbits,abits; int x,y,c; + int range = font->maxascii; c=0; - for(s=0;smaxascii;s++) + if(useDefineFont2 && range > 256) { + range = 256; + } + + for(s=0;sascii2glyph[s]; if(g>=0) { @@ -989,11 +994,11 @@ void swf_WriteFont(SWFFONT*font, char* filename) rgb.g = 0x00; rgb.b = 0x00; ypos = 1; - for(y=0;y<((font->maxascii+15)/16);y++) + for(y=0;y<((range+15)/16);y++) { int c=0,lastx=-1; for(x=0;x<16;x++) { - int g = (y*16+xmaxascii)?font->ascii2glyph[y*16+x]:-1; + int g = (y*16+xascii2glyph[y*16+x]:-1; if(g>=0 && font->glyph[g].shape) { c++; if(lastx<0) @@ -1004,7 +1009,7 @@ void swf_WriteFont(SWFFONT*font, char* filename) swf_TextSetInfoRecord(t,font,textscale,&rgb,lastx+1,textscale*ypos*2); for(x=0;x<16;x++) { - int g = (y*16+xmaxascii)?font->ascii2glyph[y*16+x]:-1; + int g = (y*16+xascii2glyph[y*16+x]:-1; if(g>=0 && font->glyph[g].shape) { if(lastx != x*xmax) { swf_TextSetInfoRecord(t,0,0,0,x*xmax+1,0);