--- 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 @@ -2391,6 +2391,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); } } @@ -4338,6 +4339,9 @@ void TextSelectionPainter::visitWord (Te { state->setFillColor(glyph_color); out->updateFillColor(state); + + while (begin < end && begin > 0 && word->charcode[begin] == CHARCODE_LIGATED) + begin--; while (begin < end) { TextFontInfo *font = word->font[begin]; @@ -4362,8 +4366,9 @@ void TextSelectionPainter::visitWord (Te out->beginString(state, string); for (int i = begin; i < fEnd; i++) { - out->drawChar(state, word->textMat[i].m[4], word->textMat[i].m[5], 0, 0, 0, 0, - word->charcode[i], 1, NULL, 0); + if (word->charcode[i] != CHARCODE_LIGATED) + out->drawChar(state, word->textMat[i].m[4], word->textMat[i].m[5], 0, 0, 0, 0, + word->charcode[i], 1, NULL, 0); } out->endString(state); delete string;