fixed "bad code offset" bug.
authorkramm <kramm>
Tue, 17 Aug 2004 16:35:29 +0000 (16:35 +0000)
committerkramm <kramm>
Tue, 17 Aug 2004 16:35:29 +0000 (16:35 +0000)
lib/modules/swfdraw.c
lib/modules/swffont.c
lib/modules/swftext.c

index 03b673c..723b253 100644 (file)
@@ -160,6 +160,8 @@ static void swf_ShapeDrawerSplineTo(drawer_t*draw, FPOINT * c1, FPOINT*  to)
 static void swf_ShapeDrawerFinish(drawer_t*draw)
 {
     SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal;
+    if(sdraw->isfinished)
+       return;
        
     fixEndPoint(draw);
 
index e5ff9ee..95c19c2 100644 (file)
@@ -266,8 +266,6 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename)
            continue;
        }
 
-       draw.finish(&draw);
-
 #if 0
        if(bbox.xMin > 0) {
            font->glyph[font->numchars].advance = (bbox.xMax*FT_SCALE)/FT_SUBPIXELS;
index 7d8c79a..c4b162f 100644 (file)
@@ -312,6 +312,8 @@ int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag)
        if (glyphcount)         /* this _if_ is not in the specs */
            swf_GetU16(tag);    // fontcodeoffset
     }
+    /* TODO: we should use the offset positions, not just
+             blindly read in shapes */
     for (t = 0; t < glyphcount; t++)
        swf_GetSimpleShape(tag, &(font->glyph[t].shape));
 
@@ -835,7 +837,7 @@ int swf_FontSetDefine2(TAG * tag, SWFFONT * f)
        swf_SetBlock(tag, f->name, strlen(f->name));
     } else {
        /* font name (="") */
-       swf_SetU8(tag, 0);      /*placeholder */
+       swf_SetU8(tag, 0);
     }
     /* number of glyphs */
     swf_SetU16(tag, f->numchars);
@@ -866,8 +868,7 @@ int swf_FontSetDefine2(TAG * tag, SWFFONT * f)
            if(f->glyph[t].shape) {
                swf_SetSimpleShape(tag, f->glyph[t].shape);
            } else {
-               swf_SetU8(tag, 0);
-               swf_SetU8(tag, 0);
+               swf_SetU8(tag, 0); //non-edge(1) + edge flags(5)
            }
        }
     }