Bug 61795 - Weak Characters (like brackets) are mispositioned with mixed RTL and LTR
Summary: Weak Characters (like brackets) are mispositioned with mixed RTL and LTR
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version: 3.6.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
: 68092 (view as bug list)
Depends on:
Blocks: rtl-meta
  Show dependency treegraph
 
Reported: 2013-03-04 15:23 UTC by Shlomi Israely
Modified: 2013-11-29 07:11 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
test case (12.69 KB, application/vnd.oasis.opendocument.text)
2013-03-04 15:23 UTC, Shlomi Israely
Details

Description Shlomi Israely 2013-03-04 15:23:12 UTC
Created attachment 75900 [details]
test case

When mixing text of an RTL language (Hebrew) and LTR language (English) many times brackets are misplaced.

This causes inability to mix texts from English and other languages, thus making Writer unusable for day to day use.
reproduce-able text:
Hello (עול)ם
expected text:
Hello ‏(עול)ם

as you can see, the parenthesis is misplaced in the first example.  

Todays LibreOffice's solution is to add LRM and RLM chars in the correct place, this is very unintuitive for 90% of the users.

I think the BiDi algorithm should be enhanced, and place LRM/RLM automatically according to the current window's keyboard layout. That is if the paragraph is RTL but the layout is English then put an LRM char before the weak char. This is what the user usually expects to happen.

I've attached a test case .odt file.

A similar bug with brackets is:
https://bugs.freedesktop.org/show_bug.cgi?id=56408
It might have a similar cause , but it's a different bug.
Comment 1 Amir E. Aharoni 2013-03-07 11:36:10 UTC
The really good way to resolve this is not to change the Unicode bidi algorithm, but to add support for inline direction marking to the OpenDocument standard and then implement it in LibreOffice. Put simply, HTML has <div dir="rtl"> and <span dir="rtl">, and OpenDocument only has something like <div dir="rtl">, but not <span dir="rtl">.

Using directionality marks like RLM, RLE and PDF is not a robust way to resolve this, although if they are used internally and the user doesn't have to use them directly, it's probably OK.

I tried to bring this issue up several times on the OpenDocument mailing list, but didn't get any useful replies. See here:
https://lists.oasis-open.org/archives/office-comment/201110/msg00000.html

There may be some challenges with implementing this, but before discussing the implementation challenges, it must be agreed to make the change in the standard that LibreOffice is implementing.
Comment 2 Maxim Monastirsky 2013-08-14 14:28:27 UTC
*** Bug 68092 has been marked as a duplicate of this bug. ***


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.