
#include <mingpp.h>

int main()
{
  Ming_init();
  Ming_setScale(1.0);

  SWFShape *s = new SWFShape();
  SWFFont *f = new SWFFont("../common/test.fdb");

  s->setRightFill(s->addSolidFill(0xff, 0, 0));
  s->setLine(40, 0x7f, 0, 0);
  s->drawGlyph(f, '!');
  s->movePen(f->getWidth("!"), 0);

  s->setRightFill(s->addSolidFill(0xff, 0x7f, 0));
  s->setLine(40, 0x7f, 0x3f, 0);
  s->drawGlyph(f, '#');
  s->movePen(f->getWidth("#"), 0);

  s->setRightFill(s->addSolidFill(0xff, 0xff, 0));
  s->setLine(40, 0x7f, 0x7f, 0);
  s->drawGlyph(f, '%');
  s->movePen(f->getWidth("%"), 0);

  s->setRightFill(s->addSolidFill(0, 0xff, 0));
  s->setLine(40, 0, 0x7f, 0);
  s->drawGlyph(f, '*');
  s->movePen(f->getWidth("*"), 0);

  s->setRightFill(s->addSolidFill(0, 0, 0xff));
  s->setLine(40, 0, 0, 0x7f);
  s->drawGlyph(f, '@');

  SWFMovie *m = new SWFMovie();
  m->setDimension(3000,2000);
  m->setRate(12.0);

  SWFDisplayItem *i = m->add(s);
  i->moveTo(1500-f->getWidth("!#%*@")/2.0, 1000+f->getAscent()/2.0);

  m->save("test.swf");

  exit(0);
}
