Bug 33302 - FILEOPEN/EDITING RTL text: parentheses and brackets "(...) [...]" inverted to ")...( ]...[" with some fonts
Summary: FILEOPEN/EDITING RTL text: parentheses and brackets "(...) [...]" inverted to...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All macOS (All)
: high major
Assignee: Thorsten Behrens (allotropia)
URL:
Whiteboard:
Keywords:
: 37344 65508 (view as bug list)
Depends on: coretext 59892 60533
Blocks: RTL-CTL mab4.0
  Show dependency treegraph
 
Reported: 2011-01-20 13:05 UTC by elya.wygoda
Modified: 2013-11-14 23:03 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot of the of the bug as you can see the brackets are inverted (59.94 KB, image/png)
2011-01-20 13:05 UTC, elya.wygoda
Details
example of the bug (8.41 KB, application/vnd.oasis.opendocument.text)
2011-01-21 01:14 UTC, elya.wygoda
Details
screenshot (43.71 KB, image/png)
2011-01-21 04:08 UTC, Noel Power
Details
Screenshot on MacOS X 10.6.8 (53.09 KB, image/png)
2012-08-13 10:43 UTC, Roman Eisele
Details
PDF file showing results in LibO 3.5.7 on Win XP (114.14 KB, application/pdf)
2012-12-08 10:15 UTC, Roman Eisele
Details
The .odt test file from which the PDF was created (14.19 KB, application/vnd.oasis.opendocument.text)
2012-12-08 10:17 UTC, Roman Eisele
Details
Screencapture for the bug on linux (101.65 KB, image/png)
2012-12-08 11:00 UTC, abdulmajeed
Details
Screencapture for the bug on linux (101.65 KB, image/png)
2012-12-08 11:04 UTC, abdulmajeed
Details
Screencapture for the bug on win7 (137.05 KB, image/jpeg)
2012-12-08 12:42 UTC, abdulmajeed
Details
Linux Biolinum G, LibreOffice vs. TextEdit (75.13 KB, image/png)
2012-12-09 08:03 UTC, Ahmad Harthi
Details
Tahoma, LibreOffice vs. TextEdit (90.64 KB, image/png)
2012-12-09 08:15 UTC, Ahmad Harthi
Details
Baghdad, LibreOffice vs. TextEdit (73.05 KB, image/png)
2012-12-09 08:25 UTC, Ahmad Harthi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description elya.wygoda 2011-01-20 13:05:25 UTC
Created attachment 42238 [details]
screenshot of the of the bug as you can see the brackets are inverted

brackets in documents that are written in hebrew and were created in Microsoft Word are showing up inverted inside Libreoffice  while it doesn't happen in Microsoft word and Neooffice .
Comment 1 elya.wygoda 2011-01-20 13:46:32 UTC
actually the problem is that in each language(hebrew,english) the brackets are showing up in the wrong side in english you need to start by-) so it will work and in hebrew you need to start by-( so basically it is doing the opposite of what it is supposed to do
Comment 2 Don't use this account, use tml@iki.fi 2011-01-21 00:43:21 UTC
Please provide a sample document that when loaded into LibreOffice displays parentheses wrong.
Comment 3 elya.wygoda 2011-01-21 01:14:19 UTC
Created attachment 42258 [details]
example of the bug
Comment 4 elya.wygoda 2011-01-21 01:18:40 UTC
I have noticed that the the problem appears to happen also in documents created inside Libreoffice not only imported from Word ,
libreoffice doesn't handle well right to left brackets.
Comment 5 Noel Power 2011-01-21 04:08:50 UTC
Created attachment 42261 [details]
screenshot

Looks like this is a mac only bug, it seems to open fine ( assuming the attached images show the correct content ) in both windows and linux. Is it correct, the brackets are correct in the screenshot ?
Comment 6 Noel Power 2011-01-21 04:09:36 UTC
assuming that indeed this is mac osx specific  -> thorsten
Comment 7 elya.wygoda 2011-01-21 05:39:47 UTC
so why Neooffice (wich is based on open office.org) doesn't have that bug ,
and why in any other mac os x application this bug is not present , except  for Openoffice.org and Libreoffice in wich it is present .
mac os x is not the problem
Comment 8 elya.wygoda 2011-01-21 05:41:11 UTC
unless you meant it is a libreoffice for mac specific problem and then i have to agree with you
Comment 9 omer.jacobi 2011-06-11 02:02:12 UTC
it look like neooffice fixed this bug years ago
http://bugzilla.neooffice.org/bug.php?op=show&bugid=1637&pos=18
and there is a workaround that maybe help you to find a fix change the font to Hebrew font like Raanana
Comment 10 elya.wygoda 2011-06-11 11:04:16 UTC
(In reply to comment #9)
> it look like neooffice fixed this bug years ago
> http://bugzilla.neooffice.org/bug.php?op=show&bugid=1637&pos=18
> and there is a workaround that maybe help you to find a fix change the font to
> Hebrew font like Raanana

thanks , but i hope there will be a real fix soon
Comment 11 Lior Kaplan 2011-11-09 12:33:26 UTC
I got someone to confirm this bug happens in 3.4.3 on Mac.
Comment 12 elya.wygoda 2011-12-18 12:15:00 UTC
(In reply to comment #11)
> I got someone to confirm this bug happens in 3.4.3 on Mac.

The problem is that this bug existed long before libreoffice started but for some reason no one solved it except the neooffice developers but they won't share the fix !
why is it so complicated to solve this bug?
Comment 13 Rainer Bielefeld Retired 2012-08-10 06:19:15 UTC
Modified Version due to Comment 12

Removed Assignee and changed Status due to facts

Currently only sample document for WORD available

@Reporter
Does that also happen in DRAW / CALC?
What's the history of the sample document? In your report you say it has been "...created in Microsoft
Word", but it's an .odt?  How can the bug be reproduced with it? Please contribute an unbroken step by step instruction how to reproduce the bug.
Comment 14 elya.wygoda 2012-08-10 08:32:10 UTC
(In reply to comment #13)
> Modified Version due to Comment 12
> 
> Removed Assignee and changed Status due to facts
> 
> Currently only sample document for WORD available
> 
> @Reporter
> Does that also happen in DRAW / CALC?
> What's the history of the sample document? In your report you say it has been
> "...created in Microsoft
> Word", but it's an .odt?  How can the bug be reproduced with it? Please
> contribute an unbroken step by step instruction how to reproduce the bug.


i tested this again on mac os x 10.6.8 with Libreoffice 3.6.0 .
to replicate the bug :
1. open Libreoffice .
2. start a new document .
3. write something (in hebrew of course) and try to put brackets around (while still in hebrew) .
4. you will see that the brackets are facing the opposite direction that they should be facing.

This happens in ALL the application that are part of Libreoffice .
The issue is probably related to fonts, because if you use the raanana font with hebrew the issue doesn't occur. 
Hopefully this clears out the misunderstanding .

Btw you should have checked comment #4.

Thank you for your time.
Comment 15 Roman Eisele 2012-08-13 10:39:36 UTC
(In reply to comment #14) 
> to replicate the bug :
> 1. open Libreoffice .
> 2. start a new document .
> 3. write something (in hebrew of course) and try to put brackets around (while
> still in hebrew) .
> 4. you will see that the brackets are facing the opposite direction that they
> should be facing.

Following these steps, I can REPRODUCE this bug with LibreOffice 3.6.0.4 (Build ID: 932b512), German UI, on MacOS X 10.6.8 (Intel).

I have to confess that reproducing this bug is a bit hard for people who don’t speak/write Hebrew. First, in order to type some Hebrew, you have
(a) to activate Complex Text Layout (CTL) in the LibO preferences;
(b) to activate the Hebrew keyboard/input in the MacOS X System Preferences
    and to switch to it via the keyboard/input menu;
(c) to show the keyboard preview window in order to find the ( ) keys
    which in Hebrew are at different places than in English, German, etc.
Secondly, it is hard to type a foreign script without knowing it ;-)
This may explain why this bug did not receive much attention ... sorry!

But as far as I can tell, it does not make any difference if you type "real" Hebrew (I tried the first words of book Genesis) or just nonsense in Hebrew glyphs: the parentheses are facing the opposite direction in both cases!


> This happens in ALL the application that are part of Libreoffice.

Confirmed; I tried Writer, Calc, and Impress: IMHO no difference.


> The issue is probably related to fonts, because if you use the raanana font
> with hebrew the issue doesn't occur. 

A very good observation! If I play around with the sample file (attachment 42258 [details]), the parentheses are right if I change the font to
-- Raanana
-- Lucida Grande
-- New Peninim MT
-- Arial Hebrew
-- Corsiva Hebrew

But the parentheses look wrong if I change the font to
-- Times New Roman
-- Arial Unicode MS (default font!)
-- Linux Libertine G
-- Linux Libertine O

I don't know what exactly makes the difference, but I suspect that the parentheses got rendered correctly with fonts which are either explictely Hebrew fonts (and probably known to LibreOffice as that): Raanana, New Peninim MT, Arial Hebrew, and Corsiva Hebrew), or are MacOS X System fonts including Hebrew (Lucida Grande). The other fonts (Times New Roman, Arial Unicode MS, Linux Libertine G/O) do really contain Hebrew glyphs, but maybe they are not known as valid Hebrew fonts to LibO?


A final remark:
We are talking about parentheses (parens: '(' ')'), not about brackets, as the screenshot and the sample file confirm. But brackets '[' ']' suffer from exactly the same problem, too! They are exchanged (flipped horizontally) just like the parentheses. -> Adjusted the bug summary.
Comment 16 Roman Eisele 2012-08-13 10:43:15 UTC
Created attachment 65493 [details]
Screenshot on MacOS X 10.6.8

For comparison with Noel Power's screenshot: the same .odt file, opened in LibO 3.6.0.4 on MacOS X 10.6.8.

(BTW: notice the Window title -- wrong, isn't it? -- but this is another bug.)
Comment 17 Rainer Bielefeld Retired 2012-08-13 12:06:34 UTC
This is all really sophisticated, to be honest, I have no idea how that RTL works, and so I have no Idea what is expeted and what not.

I found "See Also" AOOo bug, sounds a little similar, but is for all OS, and I observed with German Keyboard, CTL activated, Direction RTL, Server Installation of  "LibreOffice 3.6.0.4  German UI/Locale [Build-ID:  932b512] on German WIN7 Home Premium (64bit):

Attachment 42258 [details] "example of the bug"
a) type "(" (<shift+8>)  see a ")"
b) type ")" (<shift+9>)  see a "("
c) type "(123) (456) " shows " (456) (123)" 
So result in screen always shows opposite of typed parentheses, but result seems to be ok?
Changing to Hebrew keyboard layout did not work for me.

so my question is: what die I prove? That the problem does not occur under WIN? or did I complete nonsense?

At least I can say that I see " (עולם)" in " example of the bug", not " )עולם("
Is that enough to say that this one really is MAC only?
Comment 18 Urmas 2012-08-13 12:21:50 UTC
On Windows XP, only Linux Libertine/Biolinum fonts show this behavior, classic fonts like David & co., Arial/Courier New/Times New Roman and Arial Unicode show mirrored brackets correctly.
Comment 19 Roman Eisele 2012-08-16 13:34:32 UTC
(In reply to comment #17)
> At least I can say that I see " (עולם)" in " example of the bug", not " )עולם("
> Is that enough to say that this one really is MAC only?

I would say "no", because of Urmas’ observation:

(In reply to comment #18)
> On Windows XP, only Linux Libertine/Biolinum fonts show this behavior

Because of this observation, I would think (but I may be wrong) that this is a cross-platform bug, only the list of fonts which cause it to appear is different, and much shorter on Windows than on MacOS X.

@Rainer:
Can you confirm Urmas’ observation -- i.e., if you open the sample .odt file ("example of the bug") on Windows and set the font to Linux Libertine or Biolinum, do you see " (עולם)" or " )עולם("? If you see " )עולם(", I would say this is a cross-platform bug.


Maybe some developer could tell us if there is somewhere in LibreOffice a mechanism (maybe even a simple list?) which decides if a font is valid for Hebrew, and just fails for Linux Libertine/Biolinum on Windows, and for some more fonts on MacOS X?
Comment 20 Roman Eisele 2012-08-31 08:43:12 UTC
*** Bug 37344 has been marked as a duplicate of this bug. ***
Comment 21 Michael Meeks 2012-12-07 14:50:19 UTC
Ahmad - do you see this ? at least under Linux - I struggle to reproduce this; and I suspect it'd be best to have some RTL / coding experts to have a look - seems to be font specific; any chance you can help out ? :-)
Comment 22 Ahmad Harthi 2012-12-07 21:11:48 UTC
(In reply to comment #21)
> Ahmad - do you see this ? at least under Linux - I struggle to reproduce
> this;

It's a Mac specific bug, this bug doesn't appear in both Windows and Linux. If I'm not wrong OSX have a slightly different way mapping RTL numbers and symbols. Anyway LO doesn't offer a useable RTL support under OSX right now.

> any chance you can help out ? :-)

Sure :-)
Comment 23 Roman Eisele 2012-12-08 10:12:13 UTC
(In reply to comment #22)
> It's a Mac specific bug, this bug doesn't appear in both Windows and Linux.

I am not completely confident if this is true. Of course, we all (including myself) have assumed that for a long time, but there is still Urmas’
comment #18:
> On Windows XP, only Linux Libertine/Biolinum fonts show this behavior

And this is true. At least on Windows XP, I had the following interesting results:
* The parentheses are rendered correctly with
  Times New Roman, Arial, Courier New, Alphabetum Unicode
  -- all these are normal .ttf fonts.
* The parentheses are also rendered correctly with
  Linux Libertine O and Linux Biolinum O
  -- i.e. with the OpenType Type 1 versions of these fonts
* But the parentheses are rendered wrong with
  Linux Libertine G and Linux Biolinum G
  -- i.e. with the .ttf/Graphite versions of these fonts.

So, is it possible that this bug is really font-specific, just that it affects *many* fonts on Mac OS X and only a *few* fonts on Windows XP?!

And/or is it possible that it is related to Graphite rendering? The fact that Linux Libertine O and Linux Biolinum O are rendered correctly, but the Graphite versions (Linux Libertine G and Linux Biolinum G) are rendered wrong, points into that direction ...

*Or* is this/are these different bugs, and we have one bug on Mac OS X, and a (less visible) bug on Windows XP? Possible ...


Anyway, please check this first: is the problem with Linux Libertine G and Linux Biolinum G also reproducible under Linux? If yes -- it might be helpful to debug this issue first, because it would be definitely a cross-platform bug.
Comment 24 Roman Eisele 2012-12-08 10:15:56 UTC
Created attachment 71188 [details]
PDF file showing results in LibO 3.5.7 on Win XP



To support my hints in the previous comments, here is a PDF file exported from LibO 3.5.7 on WinXP; it confirms that this bug (or something similar ;-) exists in LibO for Windows, too, at least with the Graphite version of the Libertine and Biolinum fonts.
Comment 25 Roman Eisele 2012-12-08 10:17:35 UTC
Created attachment 71189 [details]
The .odt test file from which the PDF was created
Comment 26 abdulmajeed 2012-12-08 11:00:48 UTC
Created attachment 71190 [details]
Screencapture for the bug on linux

I have reproduced this bug on Linux-fedora 16-64bit/4.0.0.0.alpha1+
and i conform it 
i used 
Linux Biolinum G and Linux Libertine G fonts.


also if you notice the attachment the font name is reversed 

the problem also happened with Square brackets
Comment 27 abdulmajeed 2012-12-08 11:04:05 UTC
Created attachment 71191 [details]
Screencapture for the bug on linux
Comment 28 abdulmajeed 2012-12-08 12:42:41 UTC
Created attachment 71196 [details]
Screencapture for the bug on win7

I have reproduced this bug on win7 HomeBasic sp1 64bit/LibreOffice 3.6.3.2
and i conform it 

the same problem happened here


i used 
Linux Biolinum G and Linux Libertine G fonts.


also if you notice the attachment the font name is reversed 

the problem also happened with Square brackets
Comment 29 Ahmad Harthi 2012-12-09 08:03:22 UTC
Created attachment 71225 [details]
Linux Biolinum G, LibreOffice vs. TextEdit

Linux Biolinum G works fine with OSX TextEdit
Comment 30 Ahmad Harthi 2012-12-09 08:15:56 UTC
Created attachment 71226 [details]
Tahoma, LibreOffice vs. TextEdit

Using Tahoma which have a good support for Arabic we have a different result, broken letters, and inverted brackets.

You can see it working fine with TextEdit.
Comment 31 Ahmad Harthi 2012-12-09 08:25:08 UTC
Created attachment 71227 [details]
Baghdad, LibreOffice vs. TextEdit

Using Baghdad font, it works as expected!

The fonts are not responsible for the bad representation, even Linux Biolinum G font works fine with TextEdit.
Comment 32 Roman Eisele 2012-12-11 14:43:10 UTC
It seems that the time has come to move all remaining and important bugs from the “LibreOffice 3.5 Most Annoying Bugs” list to the “LibreOffice 3.6 Most Annoying Bugs” list.

So, while the details of the present bug are still a bit unclear, it is IMHO in any case still a valid and important bug report, and therefore qualified to be moved to the newer MAB list. Our recent findings which confirm that either this bug or a very similar issue is (with *some* fonts) also reproducible on Windows and Linux (thank you, Ahmad Harthi!) has increased the importance of this bug.

Therefore I move this bug from the 3.5 MAB list (bug 37361) to the 3.6 MAB list (bug 44446).
Comment 33 Roman Eisele 2012-12-11 14:44:21 UTC
(In reply to comment #32)
> ... thank you, Ahmad Harthi! ...

Sorry, I forgot: thank you, abdulmajeed, too!
Comment 34 Urmas 2013-02-09 16:28:28 UTC
*** Bug 60534 has been marked as a duplicate of this bug. ***
Comment 35 Lior Kaplan 2013-02-09 19:10:19 UTC
(In reply to comment #15)
> (In reply to comment #14) 
> > The issue is probably related to fonts, because if you use the raanana font
> > with hebrew the issue doesn't occur. 
> 
> A very good observation! If I play around with the sample file (attachment
> 42258 [details]), the parentheses are right if I change the font to
> -- Raanana
> -- Lucida Grande
> -- New Peninim MT
> -- Arial Hebrew
> -- Corsiva Hebrew
> 
> But the parentheses look wrong if I change the font to
> -- Times New Roman
> -- Arial Unicode MS (default font!)
> -- Linux Libertine G
> -- Linux Libertine O

Just to clear some mix up:
There's a general Graphite fonts problem with RTL and brackets (bug 60534) which is reproducible on other OSes. The rest is Mac specific problem. So, if you want to test/reproduce this bug, please don't use "Linux Libertine G" or "Linux Biolinum G" fonts.
Comment 36 Michael Meeks 2013-05-21 10:21:48 UTC
potentially worth testing a recent build of 4.1 on Mac since they switched to coretext - which may have side-effects in this area ;-)
Comment 37 abdulmajeed 2013-05-21 17:51:49 UTC
Seems to be fixed after switching to core text
can any one else verify
Comment 38 Ahmad Harthi 2013-05-28 11:34:02 UTC
I can confedintly say this bug is FIXED. You can try it in LO 4.1 Beta1.
Comment 39 Lior Kaplan 2013-05-28 18:26:55 UTC
I asked the bug reporter to verify the fix with 4.1 beta1, and he says it's OK. Finally (:

Notice that coretext is enabled by default (commit 2d55b2e5ae0d4f1a05e1ce5b20a7b342d6ea8b1d).
Comment 40 Faisal Menawer 2013-06-25 13:05:59 UTC
*** Bug 65508 has been marked as a duplicate of this bug. ***
Comment 41 Michael Meeks 2013-09-10 08:42:29 UTC
bug#60533 still open and trickling up to 3.6 mab list somehow (is 60533 really still open ?).
Comment 42 Lior Kaplan 2013-09-10 09:05:35 UTC
(In reply to comment #41)
> bug#60533 still open and trickling up to 3.6 mab list somehow (is 60533
> really still open ?).

Yes, the fix for it caused regressions, so it was reverted. See bug 60533 comments for more info.