X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=f6274bbc629167a9fa163ec4de7f8e72ec78f031;hb=b8573ee9e8a629c9a19f614ca3c4d64c93901eab;hp=defd24ea4438baf367cfedc652ea5d09956ab334;hpb=f77c3294fb642df5e1d07d1e5f9b12db08f01c5a;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index defd24e..f6274bb 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -48,25 +48,27 @@ #include "swfoutput.h" #include "../lib/log.h" -#include "ttf2pt1.h" #include static PDFDoc*doc = 0; static char* swffilename = 0; -int numpages; -int currentpage; +static int numpages; +static int currentpage; + +static char*fonts[2048]; +static int fontnum = 0; // swf <-> pdf pages -int*pages = 0; -int pagebuflen = 0; -int pagepos = 0; +static int*pages = 0; +static int pagebuflen = 0; +static int pagepos = 0; -double caplinewidth = 3.0; +static double caplinewidth = 3.0; static void printInfoString(Dict *infoDict, char *key, char *fmt); static void printInfoDate(Dict *infoDict, char *key, char *fmt); -double fontsizes[] = +static double fontsizes[] = { 0.833,0.833,0.889,0.889, 0.788,0.722,0.833,0.778, @@ -74,7 +76,7 @@ double fontsizes[] = 0.576,0.576,0.576,0.576, 0.733 //? }; -char*fontnames[]={ +static char*fontnames[]={ "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", @@ -99,20 +101,20 @@ struct mapping { char*filename; int id; } pdf2t1map[] ={ -{"Times-Roman", "n021003l.pfb"}, -{"Times-Italic", "n021023l.pfb"}, -{"Times-Bold", "n021004l.pfb"}, -{"Times-BoldItalic", "n021024l.pfb"}, -{"Helvetica", "n019003l.pfb"}, -{"Helvetica-Oblique", "n019023l.pfb"}, -{"Helvetica-Bold", "n019004l.pfb"}, -{"Helvetica-BoldOblique", "n019024l.pfb"}, -{"Courier", "n022003l.pfb"}, -{"Courier-Oblique", "n022023l.pfb"}, -{"Courier-Bold", "n022004l.pfb"}, -{"Courier-BoldOblique", "n022024l.pfb"}, -{"Symbol", "s050000l.pfb"}, -{"ZapfDingbats", "d050000l.pfb"}}; +{"Times-Roman", "n021003l"}, +{"Times-Italic", "n021023l"}, +{"Times-Bold", "n021004l"}, +{"Times-BoldItalic", "n021024l"}, +{"Helvetica", "n019003l"}, +{"Helvetica-Oblique", "n019023l"}, +{"Helvetica-Bold", "n019004l"}, +{"Helvetica-BoldOblique", "n019024l"}, +{"Courier", "n022003l"}, +{"Courier-Oblique", "n022023l"}, +{"Courier-Bold", "n022004l"}, +{"Courier-BoldOblique", "n022024l"}, +{"Symbol", "s050000l"}, +{"ZapfDingbats", "d050000l"}}; class GfxState; class GfxImageColorMap; @@ -210,7 +212,7 @@ public: XRef*xref; - int searchT1Font(char*name); + char* searchFont(char*name); char* substituteFont(GfxFont*gfxFont, char*oldname); char* writeEmbeddedFontToFile(XRef*ref, GfxFont*font); int t1id; @@ -452,7 +454,7 @@ SWFOutputDev::SWFOutputDev() // printf("SWFOutputDev::SWFOutputDev() \n"); }; -T1_OUTLINE* gfxPath_to_T1_OUTLINE(GfxState*state, GfxPath*path) +SWF_OUTLINE* gfxPath_to_SWF_OUTLINE(GfxState*state, GfxPath*path) { int num = path->getNumSubpaths(); int s,t; @@ -462,11 +464,11 @@ T1_OUTLINE* gfxPath_to_T1_OUTLINE(GfxState*state, GfxPath*path) double lastx=0,lasty=0; if(!num) { msg(" empty path"); - outline->type = T1_PATHTYPE_MOVE; + outline->type = SWF_PATHTYPE_MOVE; outline->dest.x = 0; outline->dest.y = 0; outline->link = 0; - return (T1_OUTLINE*)outline; + return (SWF_OUTLINE*)outline; } for(t = 0; t < num; t++) { GfxSubpath *subpath = path->getSubpath(t); @@ -480,10 +482,10 @@ T1_OUTLINE* gfxPath_to_T1_OUTLINE(GfxState*state, GfxPath*path) if(s==0) { last = outline; - outline->type = T1_PATHTYPE_MOVE; + outline->type = SWF_PATHTYPE_MOVE; outline->dest.x = x; outline->dest.y = y; - outline->link = (T1_OUTLINE*)new bezierpathsegment(); + outline->link = (SWF_OUTLINE*)new bezierpathsegment(); outline = (bezierpathsegment*)outline->link; cpos = 0; lastx = nx; @@ -506,9 +508,9 @@ T1_OUTLINE* gfxPath_to_T1_OUTLINE(GfxState*state, GfxPath*path) last = outline; outline->dest.x = x; outline->dest.y = y; - outline->type = cpos?T1_PATHTYPE_BEZIER:T1_PATHTYPE_LINE; + outline->type = cpos?SWF_PATHTYPE_BEZIER:SWF_PATHTYPE_LINE; outline->link = 0; - outline->link = (T1_OUTLINE*)new bezierpathsegment(); + outline->link = (SWF_OUTLINE*)new bezierpathsegment(); outline = (bezierpathsegment*)outline->link; cpos = 0; lastx = nx; @@ -517,7 +519,7 @@ T1_OUTLINE* gfxPath_to_T1_OUTLINE(GfxState*state, GfxPath*path) } } last->link = 0; - return (T1_OUTLINE*)start; + return (SWF_OUTLINE*)start; } /*---------------------------------------------------------------------------- * Primitive Graphic routines @@ -538,7 +540,7 @@ void SWFOutputDev::stroke(GfxState *state) m.m11 = 1; m.m21 = 0; m.m22 = 1; m.m12 = 0; m.m13 = 0; m.m23 = 0; - T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path); + SWF_OUTLINE*outline = gfxPath_to_SWF_OUTLINE(state, path); lineJoin = 1; // other line joins are not yet supported by the swf encoder // TODO: support bevel joints @@ -569,7 +571,7 @@ void SWFOutputDev::fill(GfxState *state) struct swfmatrix m; m.m11 = 1; m.m21 = 0; m.m22 = 1; m.m12 = 0; m.m13 = 0; m.m23 = 0; - T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path); + SWF_OUTLINE*outline = gfxPath_to_SWF_OUTLINE(state, path); swfoutput_setdrawmode(&output, DRAWMODE_FILL); swfoutput_drawpath(&output, outline, &m); } @@ -580,7 +582,7 @@ void SWFOutputDev::eoFill(GfxState *state) struct swfmatrix m; m.m11 = 1; m.m21 = 0; m.m22 = 1; m.m12 = 0; m.m13 = 0; m.m23 = 0; - T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path); + SWF_OUTLINE*outline = gfxPath_to_SWF_OUTLINE(state, path); swfoutput_setdrawmode(&output, DRAWMODE_EOFILL); swfoutput_drawpath(&output, outline, &m); } @@ -592,7 +594,7 @@ void SWFOutputDev::clip(GfxState *state) m.m11 = 1; m.m22 = 1; m.m12 = 0; m.m21 = 0; m.m13 = 0; m.m23 = 0; - T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path); + SWF_OUTLINE*outline = gfxPath_to_SWF_OUTLINE(state, path); swfoutput_startclip(&output, outline, &m); clipping[clippos] ++; } @@ -603,7 +605,7 @@ void SWFOutputDev::eoClip(GfxState *state) struct swfmatrix m; m.m11 = 1; m.m21 = 0; m.m22 = 1; m.m12 = 0; m.m13 = 0; m.m23 = 0; - T1_OUTLINE*outline = gfxPath_to_T1_OUTLINE(state, path); + SWF_OUTLINE*outline = gfxPath_to_SWF_OUTLINE(state, path); swfoutput_startclip(&output, outline, &m); clipping[clippos] ++; } @@ -634,7 +636,6 @@ void SWFOutputDev::beginString(GfxState *state, GString *s) swfoutput_setfontmatrix(&output, m11, -m21, m12, -m22); } -int charcounter = 0; void SWFOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, @@ -647,7 +648,7 @@ void SWFOutputDev::drawChar(GfxState *state, double x, double y, GfxFont*font = state->getFont(); if(font->getType() == fontType3) { - /* type 3 chars are passed primarily as graphics */ + /* type 3 chars are passed as graphics */ return; } double x1,y1; @@ -659,39 +660,29 @@ void SWFOutputDev::drawChar(GfxState *state, double x, double y, if(_u) u = *_u; - msg(" drawChar(%f,%f,%f,%f,'%c',%d) CID=%d\n",x,y,dx,dy,c,u, font->isCIDFont()); + msg(" drawChar(%f,%f,%f,%f,c='%c' (%d),u=%d <%d>) CID=%d\n",x,y,dx,dy,c,c,u, uLen, font->isCIDFont()); - if(font->isCIDFont()) { + /* find out the character name */ + char*name=0; + if(font->isCIDFont() && u) { GfxCIDFont*cfont = (GfxCIDFont*)font; - char*name=0; - if(u) { - int t; - for(t=0;t couldn't get name for CID character %02x from Encoding", c); - swfoutput_drawchar(&output, x1, y1, "", c, u); + int t; + for(t=0;tgetEncoding(); - if(enc && enc[c]) - swfoutput_drawchar(&output, x1, y1, enc[c], c, u); - else { - msg(" couldn't get name for character %02x from Encoding", c); - swfoutput_drawchar(&output, x1, y1, "", c, u); - } + name = enc[c]; } + + int ret = swfoutput_drawchar(&output, x1, y1, name, c, u); } void SWFOutputDev::endString(GfxState *state) @@ -912,58 +903,31 @@ void SWFOutputDev::restoreState(GfxState *state) { char type3Warning=0; -int SWFOutputDev::searchT1Font(char*name) +char* SWFOutputDev::searchFont(char*name) { int i; - int mapid=-1; char*filename=0; msg(" SearchT1Font(%s)", name); + /* see if it is a pdf standard font */ for(i=0;i Loading extra font %s from %s\n", FIXNULL(fontname), - FIXNULL(T1_GetFontFileName(i))); - } - - if(fontname && !strcmp(name, fontname)) { - msg(" Extra font %d, \"%s\" is being used.\n", i, fontname); - return i; - } - fontname = T1_GetFontFileName(i); - if(strrchr(fontname,'/')) - fontname = strrchr(fontname,'/')+1; - - if(strstr(fontname, name)) { - msg(" Extra font %d, \"%s\" is being used.\n", i, fontname); - return i; - } + return fonts[i]; } } - return -1; + return 0; } void SWFOutputDev::updateLineWidth(GfxState *state) @@ -1004,112 +968,87 @@ void SWFOutputDev::updateStrokeColor(GfxState *state) char*SWFOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font) { - char*tmpFileName = NULL; - FILE *f; - int c; - char *fontBuf; - int fontLen; - Ref embRef; - Object refObj, strObj; - char namebuf[512]; - tmpFileName = mktmpname(namebuf); - int ret; - - ret = font->getEmbeddedFontID(&embRef); - if(!ret) { - msg(" Didn't get embedded font id"); - /* not embedded- the caller should now search the font - directories for this font */ - return 0; - } + char*tmpFileName = NULL; + FILE *f; + int c; + char *fontBuf; + int fontLen; + Ref embRef; + Object refObj, strObj; + char namebuf[512]; + tmpFileName = mktmpname(namebuf); + int ret; + + ret = font->getEmbeddedFontID(&embRef); + if(!ret) { + msg(" Didn't get embedded font id"); + /* not embedded- the caller should now search the font + directories for this font */ + return 0; + } - f = fopen(tmpFileName, "wb"); - if (!f) { - msg(" Couldn't create temporary Type 1 font file"); - return 0; + f = fopen(tmpFileName, "wb"); + if (!f) { + msg(" Couldn't create temporary Type 1 font file"); + return 0; + } + if (font->getType() == fontType1C || + font->getType() == fontCIDType0C) { + if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) { + fclose(f); + msg(" Couldn't read embedded font file"); + return 0; } - if (font->getType() == fontType1C || - font->getType() == fontCIDType0C) { - if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) { - fclose(f); - msg(" Couldn't read embedded font file"); - return 0; - } - Type1CFontFile *cvt = new Type1CFontFile(fontBuf, fontLen); - cvt->convertToType1(f); - delete cvt; - gfree(fontBuf); - } else if(font->getType() == fontTrueType) { - msg(" writing font using TrueTypeFontFile::writeTTF"); - if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) { - fclose(f); - msg(" Couldn't read embedded font file"); - return 0; - } - TrueTypeFontFile *cvt = new TrueTypeFontFile(fontBuf, fontLen); - cvt->writeTTF(f); - delete cvt; - gfree(fontBuf); - } else { - font->getEmbeddedFontID(&embRef); - refObj.initRef(embRef.num, embRef.gen); - refObj.fetch(ref, &strObj); - refObj.free(); - strObj.streamReset(); - int f4[4]; - char f4c[4]; - int t; - for(t=0;t<4;t++) { - f4[t] = strObj.streamGetChar(); - f4c[t] = (char)f4[t]; - if(f4[t] == EOF) - break; - } - if(t==4) { - if(!strncmp(f4c, "true", 4)) { - /* some weird TTF fonts don't start with 0,1,0,0 but with "true". - Change this on the fly */ - f4[0] = f4[2] = f4[3] = 0; - f4[1] = 1; - } - fputc(f4[0], f); - fputc(f4[1], f); - fputc(f4[2], f); - fputc(f4[3], f); - - while ((c = strObj.streamGetChar()) != EOF) { - fputc(c, f); - } - } - strObj.streamClose(); - strObj.free(); + Type1CFontFile *cvt = new Type1CFontFile(fontBuf, fontLen); + cvt->convertToType1(f); + delete cvt; + gfree(fontBuf); + } else if(font->getType() == fontTrueType) { + msg(" writing font using TrueTypeFontFile::writeTTF"); + if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) { + fclose(f); + msg(" Couldn't read embedded font file"); + return 0; } - fclose(f); + TrueTypeFontFile *cvt = new TrueTypeFontFile(fontBuf, fontLen); + cvt->writeTTF(f); + delete cvt; + gfree(fontBuf); + } else { + font->getEmbeddedFontID(&embRef); + refObj.initRef(embRef.num, embRef.gen); + refObj.fetch(ref, &strObj); + refObj.free(); + strObj.streamReset(); + int f4[4]; + char f4c[4]; + int t; + for(t=0;t<4;t++) { + f4[t] = strObj.streamGetChar(); + f4c[t] = (char)f4[t]; + if(f4[t] == EOF) + break; + } + if(t==4) { + if(!strncmp(f4c, "true", 4)) { + /* some weird TTF fonts don't start with 0,1,0,0 but with "true". + Change this on the fly */ + f4[0] = f4[2] = f4[3] = 0; + f4[1] = 1; + } + fputc(f4[0], f); + fputc(f4[1], f); + fputc(f4[2], f); + fputc(f4[3], f); - if(font->getType() == fontTrueType || - font->getType() == fontCIDType2) - { - if(!ttfinfo) { - msg(" File contains TrueType fonts"); - ttfinfo = 1; + while ((c = strObj.streamGetChar()) != EOF) { + fputc(c, f); } - char name2[512]; - char*tmp; - tmp = strdup(mktmpname((char*)name2)); - sprintf(name2, "%s", tmp); - char*a[] = {"./ttf2pt1", "-W", "0", -#ifndef USE_FREETYPE - "-p", "ttf", -#else - "-p", "ft", -#endif - "-b", tmpFileName, name2}; - msg(" Invoking %s %s %s %s %s %s %s %s",a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]); - ttf2pt1_main(8,a); - unlink(tmpFileName); - sprintf(name2,"%s.pfb",tmp); - tmpFileName = strdup(name2); } + strObj.streamClose(); + strObj.free(); + } + fclose(f); return strdup(tmpFileName); } @@ -1121,11 +1060,9 @@ int substitutepos = 0; char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname) { -/* ------------------------------ V1 */ - char*fontname = "Times-Roman"; msg(" substituteFont(,%s)", FIXNULL(oldname)); - this->t1id = searchT1Font(fontname); + char*filename = searchFont(fontname); if(substitutepos>=sizeof(substitutesource)/sizeof(char*)) { msg(" Too many fonts in file."); exit(1); @@ -1136,95 +1073,7 @@ char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname) msg(" substituting %s -> %s", FIXNULL(oldname), FIXNULL(fontname)); substitutepos ++; } - return fontname; - -/* ------------------------------ V2 */ - -/* //substitute font - char* fontname = 0; - double m11, m12, m21, m22; - int index; - int code; - double w,w1,w2; - double*fm; - double v; - if(gfxFont->getName()) { - fontname = gfxFont->getName()->getCString(); - } - -// printf("%d %s\n", t, gfxFont->getCharName(t)); - showFontError(gfxFont, 1); - if(1) { //if (!gfxFont->isCIDFont()) { FIXME: xpdf 1.01 does not have is16Bit() - if(gfxFont->isSymbolic()) { - if(fontname && (strstr(fontname,"ing"))) //Dingbats, Wingdings etc. - index = 16; - else - index = 12; - } else if (gfxFont->isFixedWidth()) { - index = 8; - } else if (gfxFont->isSerif()) { - index = 4; - } else { - index = 0; - } - if (gfxFont->isBold() && index!=16) - index += 2; - if (gfxFont->isItalic() && index!=16) - index += 1; - fontname = fontnames[index]; - // get width of 'm' in real font and substituted font - if ((code = gfxFont->getCharCode("m")) >= 0) - w1 = gfxFont->getWidth(code); - else - w1 = 0; - w2 = fontsizes[index]; - if (gfxFont->getType() == fontType3) { - // This is a hack which makes it possible to substitute for some - // Type 3 fonts. The problem is that it's impossible to know what - // the base coordinate system used in the font is without actually - // rendering the font. This code tries to guess by looking at the - // width of the character 'm' (which breaks if the font is a - // subset that doesn't contain 'm'). - if (w1 > 0 && (w1 > 1.1 * w2 || w1 < 0.9 * w2)) { - w1 /= w2; - m11 *= w1; - m12 *= w1; - m21 *= w1; - m22 *= w1; - } - fm = gfxFont->getFontMatrix(); - v = (fm[0] == 0) ? 1 : (fm[3] / fm[0]); - m21 *= v; - m22 *= v; - } else if (!gfxFont->isSymbolic()) { - // if real font is substantially narrower than substituted - // font, reduce the font size accordingly - if (w1 > 0.01 && w1 < 0.9 * w2) { - w1 /= w2; - if (w1 < 0.8) { - w1 = 0.8; - } - m11 *= w1; - m12 *= w1; - m21 *= w1; - m22 *= w1; - } - } - } - if(fontname) { - this->t1id = searchT1Font(fontname); - } - if(substitutepos>=sizeof(substitutesource)/sizeof(char*)) { - msg(" Too many fonts in file."); - exit(1); - } - if(oldname) { - substitutesource[substitutepos] = oldname; - substitutetarget[substitutepos] = fontname; - msg(" substituting %s -> %s", FIXNULL(oldname), FIXNULL(fontname)); - substitutepos ++; - } - return fontname;*/ + return filename; } void unlinkfont(char* filename) @@ -1258,117 +1107,82 @@ void unlinkfont(char* filename) void SWFOutputDev::startDoc(XRef *xref) { - this->xref = xref; + this->xref = xref; } void SWFOutputDev::updateFont(GfxState *state) { - GfxFont*gfxFont = state->getFont(); - char * fileName = 0; + GfxFont*gfxFont = state->getFont(); + + if (!gfxFont) { + return; + } + char * fontname = getFontName(gfxFont); - if (!gfxFont) { - return; - } - char * fontname = getFontName(gfxFont); - - int t; - /* first, look if we substituted this font before- - this way, we don't initialize the T1 Fonts - too often */ - for(t=0;t updateFont(%s) [cached]", fontname); + return; + } - if(swfoutput_queryfont(&output, fontname)) - { - swfoutput_setfont(&output, fontname, -1, 0); - return; - } + // look for Type 3 font + if (!type3Warning && gfxFont->getType() == fontType3) { + type3Warning = gTrue; + showFontError(gfxFont, 2); + } - // look for Type 3 font - if (!type3Warning && gfxFont->getType() == fontType3) { - type3Warning = gTrue; - showFontError(gfxFont, 2); - } + /* now either load the font, or find a substitution */ - /* now either load the font, or find a substitution */ + Ref embRef; + GBool embedded = gfxFont->getEmbeddedFontID(&embRef); - Ref embRef; - GBool embedded = gfxFont->getEmbeddedFontID(&embRef); - if(embedded) { - if (gfxFont->getType() == fontType1 || + char*fileName = 0; + int del = 0; + if(embedded && + (gfxFont->getType() == fontType1 || gfxFont->getType() == fontCIDType0C || gfxFont->getType() == fontType1C || gfxFont->getType() == fontTrueType || gfxFont->getType() == fontCIDType2 - ) + )) { - fileName = writeEmbeddedFontToFile(xref, gfxFont); - if(!fileName) { - msg(" Couldn't write font to file"); - showFontError(gfxFont,0); - return ; - } - this->t1id = T1_AddFont(fileName); - if(this->t1id<0) { - msg(" Couldn't load font from file %s", fileName); - showFontError(gfxFont,0); - unlinkfont(fileName); - return ; - } - } - else { - /* in case the font is embedded, but has an - unsupported format, we just look through the - font directories */ - int newt1id = searchT1Font(fontname); - if(newt1id<0) { - msg(" Couldn't find any suitable replacement for %s",fontname); - showFontError(gfxFont,0); - fontname = substituteFont(gfxFont, fontname); - } else - this->t1id = newt1id; - } - } else { - if(fontname) { - int newt1id = searchT1Font(fontname); - if(newt1id<0) { - showFontError(gfxFont,1); - fontname = substituteFont(gfxFont, fontname); - } else - this->t1id = newt1id; - } - else { - showFontError(gfxFont,1); - fontname = substituteFont(gfxFont, fontname); + fileName = writeEmbeddedFontToFile(xref, gfxFont); + if(!fileName) showFontError(gfxFont,0); + else del = 1; + } else { + fileName = searchFont(fontname); + if(!fileName) showFontError(gfxFont,0); } - } + if(!fileName) + fileName = substituteFont(gfxFont, fontname); - if(t1id<0) { - msg(" Current font's t1id is %d", t1id); - //showFontError(gfxFont,0); - return; - } - - /* we may have done some substitutions here, so check - again if this font is cached. */ - if(swfoutput_queryfont(&output, fontname)) - { - swfoutput_setfont(&output, fontname, -1, 0); - return; - } + if(!fileName) { + msg(" Couldn't set font %s\n", fontname); + return; + } + + msg(" updateFont(%s) -> %s", fontname, fileName); - msg(" Creating new SWF font: t1id: %d, filename: %s name:%s", this->t1id, FIXNULL(fileName), FIXNULL(fontname)); - swfoutput_setfont(&output, fontname, this->t1id, fileName); - if(fileName) - unlinkfont(fileName); + swfoutput_setfont(&output, fontname, fileName); + + if(fileName && del) + unlinkfont(fileName); } int pic_xids[1024]; @@ -1856,6 +1670,11 @@ void pdfswf_setparameter(char*name, char*value) } } +void pdfswf_addfont(char*filename) +{ + fonts[fontnum++] = filename; +} + void pdfswf_drawonlyshapes() { drawonlyshapes = 1;