X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fswfoutput.cc;h=5e5e4da03bd07d9b7f6db9a7bb3a556914001671;hb=962d892041da5c8a2d4ab9329f4b0dbb471b4917;hp=509a6e19a64dcb8eaa000f3e245d2befe80722ae;hpb=100b970fba13286c2c160f876738a5b525581117;p=swftools.git diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 509a6e1..5e5e4da 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -900,8 +900,8 @@ static void drawchar(struct swfoutput*obj, SWFFont*font, char*character, int cha { int charid = font->getSWFCharID(character, charnr); if(charid<0) { - 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; } if(shapeid>=0) @@ -917,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; } @@ -996,13 +996,18 @@ SWFFont::SWFFont(char*name, int id, char*filename) int t, outlinepos=0; char*map[256]; + char*null = 0; + if(!a) + a=&null; + t=0; while(a[t]) t++; this->charnum = t; - if(!charnum) - return; + if(!charnum) { + this->standardtablesize = 0; + } msg(" Font %s(%d): Storing %d outlines.\n", FIXNULL(name), id, charnum); this->standardtablesize = 256; @@ -1012,9 +1017,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*)); @@ -1157,7 +1171,8 @@ SWFFont::~SWFFont() } free(ptr); - free(outline); + if(outline) + free(outline); for(t=0;tstandardtable && 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; } @@ -1230,9 +1245,9 @@ 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 -1; }