X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fswfoutput.cc;h=0da570becc5f9370184e7b0b40a15c2b83247961;hb=6a9c24e4aaa166f49ea31593733b2598de6f78fd;hp=63c33cb9a53f3bf644a249edfe86b6b586a3cda7;hpb=15c29a9ed6fcebd52ca0561f01af5ccb85a47a0e;p=swftools.git diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 63c33cb..0da570b 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -899,6 +899,11 @@ static void drawchar(struct swfoutput*obj, SWFFont*font, char*character, int cha if(usefonts && ! drawonlyshapes) { int charid = font->getSWFCharID(character, charnr); + if(charid<0) { + msg(" Didn't find character '%s' (%d) in current charset (%s)", + FIXNULL(character),charnr, FIXNULL(font->getName())); + return; + } if(shapeid>=0) endshape(); if(textid<0) @@ -912,8 +917,8 @@ static void drawchar(struct swfoutput*obj, SWFFont*font, char*character, int cha char* charname = character; if(!outline) { - msg(" Didn't find %s in current charset (%s)", - FIXNULL(character),FIXNULL(font->getName())); + msg(" Didn't find character '%s' (%d) in current charset (%s)", + FIXNULL(character),charnr,FIXNULL(font->getName())); return; } @@ -1007,9 +1012,18 @@ SWFFont::SWFFont(char*name, int id, char*filename) for(t = 0; t < this->standardtablesize; t++) { char*name = T1_GetCharName(id,t); - if(!name) - name = ""; + char chh[2] = ""; + chh[0] = t; + if(!name || !strstr(name, "notdef")) { + if(t + } + } standardtable[t] = strdup(name); + msg(" Char %d is named %s\n", t, name); } outline = (T1_OUTLINE**)malloc(charnum*sizeof(T1_OUTLINE*)); @@ -1068,7 +1082,6 @@ SWFFont::SWFFont(char*name, int id, char*filename) t=0; } } - printf("done\n"); } /* free all tables, write out definefont tags */ @@ -1187,10 +1200,10 @@ T1_OUTLINE*SWFFont::getOutline(char*name, int charnr) /* if we didn't find it by name, use the names of the first 256 characters of the font to try a new name based on charnr */ if(this->standardtable && charnr>=0 && charnr < this->standardtablesize) { - return getOutline(this->standardtable[charnr], -1); + T1_OUTLINE*ret = getOutline(this->standardtable[charnr], -1); + if(ret) return ret; } - msg(" Didn't find character '%s' in font '%s'", FIXNULL(name), this->name); return 0; } @@ -1226,10 +1239,10 @@ int SWFFont::getSWFCharID(char*name, int charnr) /* if we didn't find it by name, use the names of the first 256 (or so) characters of the font to try a new name based on charnr */ if(this->standardtable && charnr>=0 && charnr < this->standardtablesize) { - return getSWFCharID(this->standardtable[charnr], -1); + int ret = getSWFCharID(this->standardtable[charnr], -1); + if(ret) return ret; } - msg(" Didn't find character '%s' in font '%s'", FIXNULL(name), this->name); - return 0; + return -1; } int SWFFont::getWidth(char*name)