1 #include <cstdlib> 2 #include <cstdio> 3 #include <mingpp.h> 4 main()5int main() 6 { 7 FILE *fontfile; 8 9 try { 10 SWFMovie *m = new SWFMovie(); 11 SWFText *text = new SWFText(2); 12 13 fontfile = fopen(MEDIADIR "/font01.fdb", "rb"); 14 if(fontfile == NULL) 15 { 16 perror(MEDIADIR "/font01.fdb"); 17 exit(EXIT_FAILURE); 18 } 19 20 SWFFont *font = new SWFFont(fontfile); 21 SWFFont *font2 = new SWFFont(MEDIADIR "/test.ttf"); 22 23 text->setFont( font); 24 text->setColor( 0, 0, 0, 0xff); 25 text->setHeight( 20); 26 text->addString( "abc", NULL); 27 text->setFont( font2); 28 text->setColor( 0xff, 0, 0, 0xff); 29 text->setHeight( 40); 30 text->addString( "def", NULL); 31 m->add(text); 32 m->nextFrame(); 33 m->save("test02.swf"); 34 } 35 catch(SWFException &e) 36 { 37 std::cerr << "SWFException: " << e.what() << std::endl << std::endl; 38 return EXIT_FAILURE; 39 } 40 return 0; 41 } 42 43