prevent against missing glyphs in swf_DrawText.
authorkramm <kramm>
Sun, 6 Jun 2004 14:24:49 +0000 (14:24 +0000)
committerkramm <kramm>
Sun, 6 Jun 2004 14:24:49 +0000 (14:24 +0000)
lib/modules/swftext.c

index 683f494..29e3fb3 100644 (file)
@@ -1265,6 +1265,10 @@ void swf_DrawText(drawer_t*draw, SWFFONT*font, int size, char*text)
        U32 c = readUTF8char(&s);
        int g = font->ascii2glyph[c];
        shape = font->glyph[g].shape;
+       if(((int)g)<0) {
+           fprintf(stderr, "No char %d in font %s\n", c, font->name?(char*)font->name:"?");
+           continue;
+       }
        shape2 = swf_ShapeToShape2(shape);
        l = shape2->lines;
        while(l) {