Opened 12 years ago

Closed 12 years ago

#3604 closed defect (fixed)

Right To Left Text is reversed in OSD

Reported by: anonymous Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Hello,

Would it be possible to include RTL langauge support in the OSD? it works fine in any other module.

Currently the text is simply reveresed and starts in the left side and not on the right side.

I know there is a "stupid" patch running around:

diff -u new/osdtypes.cpp old/osdtypes.cpp --- new/osdtypes.cpp 2005-02-26 01:32:07.000000000 +0200 +++ old/osdtypes.cpp 2005-02-05 11:06:56.000000000 +0200 @@ -3,9 +3,6 @@

#include <qregexp.h> #include <math.h>

- erez -#include <qtextcodec.h> -

#include <iostream> using namespace std;

@@ -645,18 +642,6 @@

DrawString?(surface, m_displaysize, m_message, fade, maxfade, xoff,

yoff);

}

- -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,

@@ -697,8 +682,7 @@

if (m_usingalt && m_altfont)

font = m_altfont;

+ font->DrawString?(surface, x, y, text, maxx, maxy, alphamod);

}

~

Change History (2)

comment:1 in reply to:  description Changed 12 years ago 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

comment:2 Changed 12 years ago by paulh

Resolution: fixed
Status: newclosed

This should have be fixed by [14306]

Note: See TracTickets for help on using tickets.