Bug 66568 - Text selection is broken in RTL scripts
Summary: Text selection is broken in RTL scripts
Alias: None
Product: poppler
Classification: Unclassified
Component: glib frontend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
Depends on:
Reported: 2013-07-04 02:59 UTC by Germán Poo-Caamaño
Modified: 2018-08-20 21:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

PDF Test case (112.57 KB, text/plain)
2013-07-04 02:59 UTC, Germán Poo-Caamaño
Screenshot showin the problem with selections (324.46 KB, image/png)
2013-07-04 03:03 UTC, Germán Poo-Caamaño

Description Germán Poo-Caamaño 2013-07-04 02:59:04 UTC
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)."
Comment 1 Germán Poo-Caamaño 2013-07-04 03:03:05 UTC
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.
Comment 2 GitLab Migration User 2018-08-20 21:42:32 UTC
-- 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.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.