X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=pdf2swf%2Fswfoutput.cc;fp=pdf2swf%2Fswfoutput.cc;h=81cf8b08b180fb7958cff823d092938041b664e0;hp=17e0fd2b58bf54821361a658711d4efa0aafa249;hb=332894030d2bfae848441ed7e6e909a16b40ab96;hpb=92639540a5db28c4e5cbb87bad85fa4abb886308 diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 17e0fd2..81cf8b0 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -646,11 +646,8 @@ static void putcharacter(gfxdevice_t*dev, int fontid, int charid, int x,int y, i If we set it to low, however, the char positions will be inaccurate */ #define FONT_INTERNAL_SIZE 4 -static int font_active = 0; -static char* font_active_filename = 0; - /* process a character. */ -static int drawchar(gfxdevice_t*dev, SWFFONT *swffont, char*character, int charnr, int u, swfmatrix*m, gfxcolor_t*col) +static int drawchar(gfxdevice_t*dev, SWFFONT *swffont, int charid, swfmatrix*m, gfxcolor_t*col) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; if(!swffont) { @@ -658,21 +655,8 @@ static int drawchar(gfxdevice_t*dev, SWFFONT *swffont, char*character, int charn return 0; } - int charid = getCharID(swffont, charnr, character, u); - if(font_active) { - char buf[1024]; - sprintf(buf, "%s.usage", font_active_filename); - FILE*fi = fopen(buf, "ab+"); - if(fi) { - fprintf(fi, "%d %d %d %s\n", charnr, u, charid, character); - fclose(fi); - } else - msg(" Couldn't write to %s", buf); - } - - if(charid<0) { - msg(" Didn't find character '%s' (c=%d,u=%d) in current charset (%s, %d characters)", - FIXNULL(character),charnr, u, FIXNULL((char*)swffont->name), swffont->numchars); + if(charid<0 || charid>=swffont->numchars) { + msg(" No character %d in font %s ", charid, FIXNULL((char*)swffont->name)); return 0; } /*if(swffont->glyph[charid].shape->bitlen <= 16) { @@ -681,7 +665,6 @@ static int drawchar(gfxdevice_t*dev, SWFFONT *swffont, char*character, int charn return 0; }*/ - if(i->shapeid>=0) endshape(dev); if(i->textid<0) @@ -2400,5 +2383,5 @@ static void swf_drawchar(gfxdevice_t*dev, char*fontid, int glyph, gfxcolor_t*col m.m22 = i->fontm22; m.m31 = matrix->tx; m.m32 = matrix->ty; - drawchar(dev, i->swffont, 0, glyph, -1, &m, color); + drawchar(dev, i->swffont, glyph, &m, color); }