[mythtv-commits] Ticket #3604: Right To Left Text is reversed in OSD

MythTV mythtv at cvs.mythtv.org
Tue Jun 19 13:48:57 UTC 2007


#3604: Right To Left Text is reversed in OSD
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |        Owner:  ijr    
     Type:  defect     |       Status:  new    
 Priority:  minor      |    Milestone:  unknown
Component:  mythtv     |      Version:  unknown
 Severity:  medium     |   Resolution:         
  Mlocked:  0          |  
-----------------------+----------------------------------------------------

Comment(by anonymous):

 the patch you entered was valid for 0.19,
 here is the patch for 0.20 and hopefully svn:

 erez.
 {{{
 --- libs/libmythtv/osdtypes.cpp.orig    2006-07-05 21:27:51.000000000
 +0300
 +++ libs/libmythtv/osdtypes.cpp 2006-07-05 22:46:08.000000000 +0300
 @@ -2,6 +2,9 @@
  #include <qmap.h>
  #include <qregexp.h>

 +// erez
 +#include <qtextcodec.h>
 +
  #include <iostream>
  #include <algorithm>
  using namespace std;
 @@ -1011,6 +1014,20 @@
      }
  }

 +
 +const QString HebrewReverse(const QString text) // erez
 +{
 +  static QTextCodec *codec =NULL;
 +  static QTextCodec *codeci =NULL;
 +  if (codeci==NULL) codeci = QTextCodec::codecForName("ISO8859-8I");
 +  if (codec==NULL) codec = QTextCodec::codecForName("ISO8859-8");
 +
 +  const QString text2=codeci->toUnicode(codec->fromUnicode(text));
 +  return text2;
 +}
 +
 +
 +
  void OSDTypeText::DrawString(OSDSurface *surface, QRect rect,
                               const QString &text, int fade, int maxfade,
                               int xoff, int yoff, bool doubl)
 @@ -1040,7 +1057,7 @@
      if ((m_usingalt || m_selected) && m_altfont)
          font = m_altfont;

 -    font->DrawString(surface, rect.left(), rect.top(), text,
 +    font->DrawString(surface, rect.left(), rect.top(),
 HebrewReverse(text),
                       rect.right(), rect.bottom(), alphamod, doubl);

      // draw cursor
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3604#comment:1>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list