--- 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 @@ -2392,6 +2392,7 @@ void TextPage::addChar(GfxState *state, w1 /= uLen; h1 /= uLen; for (i = 0; i < uLen; ++i) { + if (i > 0) c = CHARCODE_LIGATED; curWord->addChar(state, curFont, x1 + i*w1, y1 + i*h1, w1, h1, charPos, nBytes, c, u[i], mat); } } @@ -4376,6 +4377,9 @@ void TextSelectionPainter::endPage() for (int i = 0; i < selectionList->getLength(); i++) { TextWordSelection *sel = (TextWordSelection *) selectionList->get(i); int begin = sel->begin; + + while (begin < sel->end && begin > 0 && word->charcode[begin] == CHARCODE_LIGATED) + begin--; while (begin < sel->end) { TextFontInfo *font = sel->word->font[begin]; @@ -4400,8 +4404,9 @@ void TextSelectionPainter::endPage() out->beginString(state, string); for (int i = begin; i < fEnd; i++) { - out->drawChar(state, sel->word->textMat[i].m[4], sel->word->textMat[i].m[5], 0, 0, 0, 0, - sel->word->charcode[i], 1, NULL, 0); + if (sel->word->charcode[i] != CHARCODE_LIGATED) + out->drawChar(state, sel->word->textMat[i].m[4], sel->word->textMat[i].m[5], 0, 0, 0, 0, + sel->word->charcode[i], 1, NULL, 0); } out->endString(state); delete string;