fixed text extraction if the font doesn't have a (working) glyph2ascii
authorkramm <kramm>
Wed, 7 Dec 2005 19:41:32 +0000 (19:41 +0000)
committerkramm <kramm>
Wed, 7 Dec 2005 19:41:32 +0000 (19:41 +0000)
src/swfdump.c

index a74c453..5da07fc 100644 (file)
@@ -275,8 +275,12 @@ void textcallback(void*self, int*glyphs, int*ypos, int nr, int fontid, int fonts
            if(glyphs[t] >= fonts[font]->numchars  /*glyph is in range*/
                    || !fonts[font]->glyph2ascii /* font has ascii<->glyph mapping */
              ) a = glyphs[t];
            if(glyphs[t] >= fonts[font]->numchars  /*glyph is in range*/
                    || !fonts[font]->glyph2ascii /* font has ascii<->glyph mapping */
              ) a = glyphs[t];
-           else
-               a = fonts[font]->glyph2ascii[glyphs[t]];
+           else {
+               if(fonts[font]->glyph2ascii[glyphs[t]])
+                   a = fonts[font]->glyph2ascii[glyphs[t]];
+               else
+                   a = glyphs[t];
+           }
        } else {
            a = glyphs[t];
        }
        } else {
            a = glyphs[t];
        }