// check for invisible text -- this is used by Acrobat Capture
if ((state->getRender() & 3) == 3)
return;
-
+ Gushort *CIDToGIDMap = 0;
GfxFont*font = state->getFont();
if(font->getType() == fontType3) {
state->transform(x, y, &x1, &y1);
Unicode u=0;
- if(_u && uLen)
+ char*name=0;
+
+ if(_u && uLen) {
u = *_u;
+ if (u) {
+ int t;
+ /* find out char name from unicode index
+ TODO: should be precomputed
+ */
+ for(t=0;t<sizeof(nameToUnicodeTab)/sizeof(nameToUnicodeTab[0]);t++) {
+ if(nameToUnicodeTab[t].u == u) {
+ name = nameToUnicodeTab[t].name;
+ break;
+ }
+ }
+ }
+ }
- /* find out the character name */
- char*name=0;
- if(font->isCIDFont() && u) {
+ if(font->isCIDFont()) {
GfxCIDFont*cfont = (GfxCIDFont*)font;
- int t;
- for(t=0;t<sizeof(nameToUnicodeTab)/sizeof(nameToUnicodeTab[0]);t++) {
- /* todo: should be precomputed */
- if(nameToUnicodeTab[t].u == u) {
- name = nameToUnicodeTab[t].name;
- break;
- }
+
+ if(font->getType() == fontCIDType2) {
+ CIDToGIDMap = cfont->getCIDToGID();
}
} else {
Gfx8BitFont*font8;
if(enc && enc[c])
name = enc[c];
}
-
- msg("<debug> drawChar(%f,%f,c='%c' (%d),u=%d <%d>) CID=%d name=\"%s\"\n",x,y,(c&127)>=32?c:'?',c,u, uLen, font->isCIDFont(), FIXNULL(name));
-
- /*x1 = (int)(x1+0.5);
- y1 = (int)(y1+0.5);*/
-
- int ret = swfoutput_drawchar(&output, x1, y1, name, c, u);
+
+ if (CIDToGIDMap) {
+ msg("<debug> drawChar(%f, %f, c='%c' (%d), GID=%d, u=%d <%d>) CID=%d name=\"%s\"\n", x, y, (c&127)>=32?c:'?', c, CIDToGIDMap[c], u, uLen, font->isCIDFont(), FIXNULL(name));
+ swfoutput_drawchar(&output, x1, y1, name, CIDToGIDMap[c], u);
+ } else {
+ msg("<debug> drawChar(%f,%f,c='%c' (%d), u=%d <%d>) CID=%d name=\"%s\"\n",x,y,(c&127)>=32?c:'?',c,u, uLen, font->isCIDFont(), FIXNULL(name));
+ swfoutput_drawchar(&output, x1, y1, name, c, u);
+ }
}
void SWFOutputDev::endString(GfxState *state) {