--- 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 @@ -1922,7 +1922,8 @@ void TextPage::addChar(GfxState *state, w1 /= uLen; h1 /= uLen; for (i = 0; i < uLen; ++i) { - curWord->addChar(state, x1 + i*w1, y1 + i*h1, w1, h1, c, u[i]); + curWord->addChar(state, x1 + i*w1, y1 + i*h1, w1, h1, + (i == 0 ? c : CHARCODE_LIGATED), u[i]); } } if (curWord) { @@ -3393,9 +3394,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);