<table><tr><td style="">chfanzil added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10455" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I've tested this patch using 2 PDF files: One in Hebrew (it was downloaded using Wikipedia's Download-as-PDF option) the other in Arabic (it was supplied with the patch).<br />
<a href="https://phabricator.kde.org/F5729640" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F5729640: Open Source (Hebrew Wikipedia).pdf</a></p>
<p><a href="https://phabricator.kde.org/F5729641" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F5729641: arabic-search-test.pdf</a></p>
<p>The results are as follows:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">Okular was able to find the text I was searching for (Success).</li>
</ol>
<ol class="remarkup-list" start="2">
<li class="remarkup-list-item">But it is looking for the text in random areas. This is caused, probably, because Okular perceives each bulk of few words as located in different areas. And not as it should:</li>
</ol>
<p>First line: first word to the right, second word to the right, third...<br />
Second line: first word to the right, second word to the right, third...<br />
Third line...<br />
..<br />
..<br />
Last line: first word to the right, second word to the right, third..., last word to the right.</p>
<p>I'm attaching a gif to illustrate this (I'm looking for the first word in the text, a 3-letter word 'קוד' (which translates to code):<br />
<a href="https://phabricator.kde.org/F5729642" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F5729642: Search RTL text in patched okular D10455 - 1.gif</a></p>
<ol class="remarkup-list" start="3">
<li class="remarkup-list-item">Okular is unable to copy RTL text correctly. The order of the words gets mixed. This can be seen when trying to select the text - the way in which the text gets selected isn't intuitive, and can also be seen when pasting the selected text - in comparison to the original text. Here is a gif to illustrate this:</li>
</ol>
<p><a href="https://phabricator.kde.org/F5729644" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F5729644: Copy RTL text in patched okular D10455.gif</a></p>
<ol class="remarkup-list" start="4">
<li class="remarkup-list-item">The same problems occur when testing with the PDF in Arabic. Selecting the text is messy and searching for a letter in the text jumps between lines up and down.</li>
</ol>
<p>Here is a gif to illustrate this (I'm looking for a common letter from the Arabic alphabet, the letter 'ا' (Alif, the first letter in the Arabic alphabet)):<br />
<a href="https://phabricator.kde.org/F5729646" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F5729646: Search RTL text in patched okular D10455 - 2.gif</a></p>
<p>To conclude:<br />
In regards to searching:<br />
<strong>unpatched okular</strong>: You need to type the text in reverse in order to search it.<br />
<strong>okular + <a href="https://phabricator.kde.org/D10455" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D10455</a></strong>: You can partially search by typing the text in the correct way, but the results will be scattered and not in the intuitive order of reading.<br />
<strong>okualr + <a href="https://phabricator.kde.org/D10298" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;" rel="noreferrer">D10298</a></strong>: You can partially search by typing the text in the correct way, but the results will come up for each line, in the opposite order, but at least it will jump from the first line, to the second, to the third, and not sporadically like <a href="https://phabricator.kde.org/D10455" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D10455</a>.</p>
<p>In regards to copying text:<br />
<strong>unpatched okular</strong>: Will copy the text in reverse (not just the order of the words, but also the order of the letters in a word), so ABC DEFG HIJK will paste as KJIH GFED CBA.<br />
<strong>okular + <a href="https://phabricator.kde.org/D10455" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D10455</a></strong>: Will copy parts of the text in the correct way. <br />
So for example: ABC DEFG HIJK LMNO PQR STUVW XYZ <br />
Will be pasted as: HIJK LMNO ABC PQR STUVW DEFG XYZ<br />
<strong>okualr + <a href="https://phabricator.kde.org/D10298" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;" rel="noreferrer">D10298</a></strong>: Like unpatched okular</p>
<p>In terms of usability, the ability to search is important, so <a href="https://phabricator.kde.org/D10298" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;" rel="noreferrer">D10298</a> is better than <a href="https://phabricator.kde.org/D10455" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D10455</a> (as it enables one to search in each line from the end of the line to the beginning of the line, and not sporadically.<br />
In regards to copying text, they're both not so good.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10455" rel="noreferrer">https://phabricator.kde.org/D10455</a></div></div><br /><div><strong>To: </strong>fahadalsaidi, Okular, aacid, ltoscano<br /><strong>Cc: </strong>chfanzil, ngraham, michaelweghorn, aacid<br /></div>