[Poppler-bugs] [Bug 9001] Ligated characters are drawn multiple times when selected

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jul 21 02:09:30 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=9001

Carlos Garcia Campos <carlosgc at gnome.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #19 from Carlos Garcia Campos <carlosgc at gnome.org> ---
(In reply to comment #18)
> Created attachment 82753 [details] [review]
> ligature-selection-paint.patch
> 
> (In reply to comment #17)
> > Ok, I think I understand better the problem now. The unicode of words is
> > normalized, but charcode of caharcters corresponds to the ligature, so that
> > we render ligatures, but extracted text and characters are split. This means
> > that for split characters we have the same charcode, but different text and
> > bounding box. This allows us to select individual characters of a ligature
> > or search for individual characters as well. Is this right? Assuming it's
> > right, what is common in all characters of a ligature while rendering is the
> > charcode and the transformation matrix, so I wonder if we could generalize
> > it and avoid rendering the same character twice always with something liked
> > this:
> > 
> > if (i > begin &&
> >     sel->word->charcode[i - 1] == sel->word->charcode[i] &&
> >     sel->word->textMat[i - 1].m[4] == sel->word->textMat[i].m[4] &&
> >     sel->word->textMat[i - 1].m[5] == sel->word->textMat[i].m[5])
> >       continue;
> > 
> > Your patch works fine, but changing the char looks a bit like a hack to me.
> 
> Yes, definitely. I'm a bit uncomfortable using the transformation matrix to
> identify characters as being from the same glyph; I'd prefer to use charPos
> as that references glyph identity directly:
> 
>     if (i != begin && sel->word->charPos[i] == sel->word->charPos[i - 1])
>       continue;

Yes, this is a lot cleaner, thanks! I've just pushed it to git master.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130721/ac54eefe/attachment.html>


More information about the Poppler-bugs mailing list