--- poppler/CharTypes.h 2006/11/13 00:15:38 1.1 +++ poppler/CharTypes.h 2006/11/13 00:36:07 @@ -20,5 +20,6 @@ typedef unsigned int CID; // - 16-bit CID // - Unicode typedef unsigned int CharCode; +#define CHARCODE_LIGATED 0xFFFFFFFF #endif --- poppler/TextOutputDev.cc 2006/11/13 00:15:43 1.1 +++ poppler/TextOutputDev.cc 2006/11/14 23:19:16 @@ -2075,6 +2075,7 @@ void TextPage::addChar(GfxState *state, w1 /= uLen; h1 /= uLen; for (i = 0; i < uLen; ++i) { + if (i > 0) c = CHARCODE_LIGATED; if (u[i] >= 0xd800 && u[i] < 0xdc00) { /* surrogate pair */ if (i + 1 < uLen && u[i+1] >= 0xdc00 && u[i+1] < 0xe000) { /* next code is a low surrogate */ @@ -3731,9 +3732,16 @@ void TextSelectionPainter::visitWord (Te out->beginString(state, string); - for (i = begin; i < end; i++) - out->drawChar(state, word->edge[i], word->base, 0, 0, 0, 0, - word->charcode[i], 1, NULL, 0); + for (i = begin; i < end && i >= 0; i--) + if (word->charcode[i] != CHARCODE_LIGATED) { + out->drawChar(state, word->edge[i], word->base, 0, 0, 0, 0, + word->charcode[i], 1, NULL, 0); + break; + } + for (i = begin + 1; i < end; i++) + if (word->charcode[i] != CHARCODE_LIGATED) + out->drawChar(state, word->edge[i], word->base, 0, 0, 0, 0, + word->charcode[i], 1, NULL, 0); out->endString(state);