+ return fileName;
+}
+
+char* gfxFontName(GfxFont* gfxFont)
+{
+ GString *gstr;
+ gstr = gfxFont->getName();
+ if(gstr) {
+ return gstr->getCString();
+ }
+ else {
+ char buf[32];
+ Ref r=gfxFont->getID();
+ sprintf(buf, "UFONT%d", r.num);
+ return strdup(buf);
+ }
+}
+
+void SWFOutputDev::updateFont(GfxState *state)
+{
+ double m11, m12, m21, m22;
+ char * fontname = 0;
+ GfxFont*gfxFont = state->getFont();
+ char * fileName = 0;
+
+ if (!gfxFont) {
+ return;
+ }
+
+ if(swfoutput_queryfont(&output, gfxFontName(gfxFont)))
+ {
+ swfoutput_setfont(&output, gfxFontName(gfxFont), -1, 0);
+ return;
+ }
+
+ // look for Type 3 font
+ if (!type3Warning && gfxFont->getType() == fontType3) {
+ type3Warning = gTrue;
+ showFontError(gfxFont, 2);
+ }
+ //dumpFontInfo ("<notice>", gfxFont);
+
+ Ref embRef;
+ GBool embedded = gfxFont->getEmbeddedFontID(&embRef);
+ if(embedded) {
+ if (!gfxFont->is16Bit() &&
+ (gfxFont->getType() == fontType1 ||
+ gfxFont->getType() == fontType1C)) {
+
+ fileName = writeEmbeddedFontToFile(gfxFont);
+ if(!fileName)
+ return ;