added a few const modifiers
[swftools.git] / lib / modules / swftext.c
index ee3923e..dcea6be 100644 (file)
@@ -801,6 +801,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 +943,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 */