Created attachment 82000 [details]
PDF Test case
I am reporting to poppler-glib, though it might be a general issue on how PDF with RTL scripts are handled in poppler. As per reported in GNOME Bugzilla:
"When I try to select text written in an RTL script (Hebrew, in my case) the
selection algorithm treats it like LTR text. This means that if I start a
selection in the midlle of a line in an RTL paragraph and move the cursor to
the middle of the next line, the selection spans to the right on the first line
and from the left up to the cursor in the next line. This is okay for LTR, but
in RTL scripts it should work exactly the opposite. The expected behaviour is
just like the GtkTextView widget's."
I tested it also with poppler-glib-demo. It is reproducible when selecting multiples lines. One of the comments has a clue of the problem:
"PDF stores Hebrew internally as visual Hebrew (LTR), so Envice will have to
detect Hebrew text and work around this.
It seems like Envice Evince 0.5.2 Using poppler 0.5.1 (splash) correctly
reverses Hebrew when pasting to gedit, but does not do the selection properly
(like Yaron noted)."
Created attachment 82001 [details]
Screenshot showin the problem with selections
Here is a screenshot showing the selection in 2 different applications with the same scripts (libreoffice and evince) as reported. I did not take a new one with poppler-glib-demo because it was easy to reproduce.
I think this bug is related to https://bugs.freedesktop.org/show_bug.cgi?id=25482. They are not exactly the same, but I think the bug fix of one would fix the another one.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/40.