Bug 59892

Summary: Text written with Graphite Font (e.g Linux Biolinum G) Mirrored when the context direction is Right-to-left
Product: LibreOffice Reporter: Ahmad Harthi <to.ahmad>
Component: graphics stackAssignee: navin patidar <patidar>
Status: VERIFIED FIXED    
Severity: major CC: aalabdulrazzaq, caolan.mcnamara, kaplanlior, navin.patidar, thb
Priority: high    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=60534
Whiteboard: target:4.1.0 target:4.0.3
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 33302    
Attachments: Graphite Font Mirrored when the context direction is RTL

Description Ahmad Harthi 2013-01-26 08:58:49 UTC
Created attachment 73673 [details]
Graphite Font Mirrored when the context direction is RTL

1. Enable CTL
2. Open a new document (Writer, Impress,... etc.)
3. Type some text
4. Change the font to any graphite font (e.g. Linux Biolinum G)
5. Change context direction to Right-to-left (not the alignment)

The text will be mirrored.
Comment 1 abdulmajeed 2013-01-26 09:28:15 UTC
This does not appear in writer , but it is in draw,calc and impress.
Comment 2 Urmas 2013-01-26 10:37:38 UTC
Also note, that text is reversed only during the editing. Inactive textbox and demonstration look fine.
Comment 3 Not Assigned 2013-02-02 07:53:35 UTC
navin patidar committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=73de30ca9ca0d3d4edd00e0e8f22451238699989

fix fdo#59892 completely and fdo#33302 partially.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Ahmad Harthi 2013-02-02 12:17:42 UTC
There will be another patch with a small code modification, the bug is completely fixed.
Comment 5 Caolán McNamara 2013-02-02 13:11:44 UTC
I think the values here returned from GetRightToLeft may be enums from UBiDiDirection, i.e. UBIDI_LTR, UBIDI_RTL, UBIDI_MIXED, UBIDI_NEUTRAL.

a quick dig around in editeng/source/editeng/impedit2.cxx has this sort of foo for turning that into a boolean fact that its a RTL hunk if that helps.

            if ( nCurrDirType % 2 == UBIDI_RTL  || // text in RTL run
                ( nCurrDirType > UBIDI_LTR && !lcl_HasStrongLTR( aText, nStart, nEnd ) ) ) // non-strong text in embedded LTR run
Comment 6 Caolán McNamara 2013-02-02 13:48:31 UTC
hmm, actually a UBiDiLevel apparently, which suggests that we want to check just the last bit for L/R, suggesting that lcl_HasStrongLTR is a bit dubious
Comment 7 navin patidar 2013-02-03 07:41:45 UTC
hi Caolán McNamara, 
thanks for the pointers. 
https://gerrit.libreoffice.org/1972,  fix logic to get L/R direction, As you suggested.
Comment 8 Lior Kaplan 2013-02-09 10:16:07 UTC
*** Bug 60534 has been marked as a duplicate of this bug. ***
Comment 9 Lior Kaplan 2013-02-09 18:47:26 UTC
Verified on master
Comment 10 Commit Notification 2013-03-14 15:54:31 UTC
navin patidar committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=065c8507bc6393468c0186370b1b991e22008b27&h=libreoffice-4-0

fix fdo#59892 completely and fdo#33302 partially.


It will be available in LibreOffice 4.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.