+TAG*swf_AddAS3FontDefine(TAG*tag, U16 id, char*fontname)
+{
+ tag = swf_InsertTag(tag, ST_DOABC);
+ abc_file_t*file = abc_file_new();
+
+ //abc_class_t*cls = abc_class_new2(file, fontname, "flash.display::MovieClip");
+ //abc_class_slot(cls, multiname_fromstring(fontname), multiname_fromstring("flash.text::Font"));
+
+ abc_class_t*cls = abc_class_new2(file, fontname, "flash.text::Font");
+
+ abc_script_t*s = abc_initscript(file);
+ code_t*c = s->method->body->code;
+ c = abc_getlocal_0(c);
+ c = abc_pushscope(c);
+ c = abc_getscopeobject(c, 0);
+ c = abc_getlex(c,"flash.text::Font");
+ c = abc_pushscope(c);
+ c = abc_getlex(c,"flash.text::Font");
+ c = abc_newclass(c,cls);
+ c = abc_popscope(c);
+ c = abc_initproperty(c, fontname);
+ c = abc_returnvoid(c);
+ s->method->body->code = c;
+
+ abc_initscript_addClassTrait(s, multiname_fromstring(fontname), cls);
+ swf_WriteABC(tag, file);
+
+ tag = swf_InsertTag(tag, ST_SYMBOLCLASS);
+ swf_SetU16(tag, 1);
+ swf_SetU16(tag, id);
+ swf_SetString(tag, fontname);
+
+ return tag;
+}
+
+