[mythtv-commits] Ticket #6004: OSD RTL Languages general fix

MythTV mythtv at cvs.mythtv.org
Sat Dec 20 22:37:12 UTC 2008

#6004: OSD RTL Languages general fix
 Reporter:  Tony Arie Kolev <kolevtony at bezeqint.net>  |        Owner:  ijr       
     Type:  defect                                    |       Status:  new       
 Priority:  major                                     |    Milestone:  0.21.1    
Component:  mythtv                                    |      Version:  0.21-fixes
 Severity:  medium                                    |   Resolution:            
  Mlocked:  0                                         |  

Comment(by Tony Arie Kolev <kolevtony at bezeqint.net>):

 I like to explain what is done to help developers to understand and
 include the patch in
 mainstream versions of MythTV.

 Short description of the problem in current stable releases:
 Texts of Right-To-Left languages are not properly displayed in some OSD
 windows like:
 1) LiveTV menu - text is going Left-To-Right and is Justified to the Left.
 2) TV Recordings menu - text is going Left-To-Right and is Justified to
 the Left.
 3) TV Program Info window - multiline text is split in wrong way, lines
 are going from bottom to top and are Justified to the Left.
 4) Other OSD pop-up windows - text is Justified to the Left.
 *) One hidden problem - there are two functions operating on RTL:
 QString OSDTypeText::BasicConvertFromRtoL(const QString &text)
 QString OSDTypeText::ConvertFromRtoL(const QString &text)
 Second is calling first one to do RTL conversion and after that is doing
 again RTL conversion (in case the fribidi is enabled).
 It is double RTL conversion!

 I have tested the patch from Ido Roseman - it is not included in last
 stable source.
 He solves Left-To-Right problem in 1) and 2), and Bottom-To-Top problem in
 But, he does not solves Left Justified text problem.
 Also he introduces one new problem - Parentheses in TV Program Info window
 are swapped like:
 some text )2006(.

 What I am doing in my patch (osd_rtl.patch):
 I am not using Ido Roseman's patch, because it moved the RTL conversion in
 ttfont.cpp and in that point is hard to make Right Justification.
 RTL conversion is needed in two different classes: OSDTypeText and
 Ido's patch uses a common for two classes class - ttfont.

 I am moving RTL conversion to NEW Class named RTL.
 That way it is possible to use it from both OSDTypeText and
 OSDListBtnTypeItem classes and possibly in future from another classes
 without moving it again.
 Also , and more important, now Right Justification can be implemented from
 the caller.
 I am introducing isRTL return variable , using embedding_level_list return
 variables from fribidi_log2vis to decide whether text is RTL and needs
 Right Justification.
 This way no configuration is needed and text is Left or Right Justified
 My patch addresses all points 1,2,3,4 mentioned above and fixes the *)
 hidden problem.

 The patch is tested in running systems on MythDora and Fedora 9, built
 Program is running stable.
 I addition some adjustment's are needed in right position of some texts,
 discovered after the texts was correctly Justified to the Right.
 I have fixed what I found in separate patch (osd.rtl.xml.patch)
 That patch is changing width of some fields in osd.xml files.

 Tony Arie Kolev,
 Linux Professional (LPIC-1 Certification),
 C,C++,Java Programmer for more than 10 years of experience.

Ticket URL: <http://svn.mythtv.org/trac/ticket/6004#comment:3>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list