aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-05-08 13:15:38 +0200
committerghost <andreas.monzner@multimedia-labs.de>2010-05-08 13:16:03 +0200
commit7ab186a904a98842266746d2bd3e479bb1cde06e (patch)
tree0c5298ad8b4bf0b0a186dbdcad05a24ae10395cb
parentded22eadf10d87828809bd40e61f7e05434924a4 (diff)
downloadenigma2-7ab186a904a98842266746d2bd3e479bb1cde06e.tar.gz
enigma2-7ab186a904a98842266746d2bd3e479bb1cde06e.zip
lib/gdi/font.cpp: try to fix wrong reordering of some characters
-rw-r--r--lib/gdi/font.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/gdi/font.cpp b/lib/gdi/font.cpp
index 2fd9fb69..1d3c34da 100644
--- a/lib/gdi/font.cpp
+++ b/lib/gdi/font.cpp
@@ -597,8 +597,7 @@ int eTextPara::renderString(const char *string, int rflags)
// now do the usual logical->visual reordering
int size=uc_shape.size();
#ifdef HAVE_FRIBIDI
- FriBidiCharType dir=FRIBIDI_TYPE_ON;
- int lines=1;
+ bool mustRealign=false;
int pos=0, spos=0;
uc_visual.resize(size);
// gaaanz lahm, aber anders geht das leider nicht, sorry.
@@ -625,23 +624,25 @@ int eTextPara::renderString(const char *string, int rflags)
default:
break;
}
- if (line_end || pos+incr >= size) {
+ if (line_end || pos+incr >= size)
+ {
int len = pos - spos;
if (len)
+ {
+ FriBidiCharType dir=FRIBIDI_TYPE_ON;
fribidi_log2vis(array+spos, len, &dir, target+spos, 0, 0, 0);
+ if (!mustRealign && dir&FRIBIDI_MASK_RTL)
+ mustRealign = true;
+ }
target[pos] = array[pos];
if (incr > 1)
target[pos+1] = array[pos+1];
spos = pos+incr;
- ++lines;
line_open = false;
}
pos += incr;
}
- if (lines < 2)
- fribidi_log2vis(array, size, &dir, target, 0, 0, 0);
-
uc_visual.assign(target, target+size);
#else
uc_visual=uc_shape;
@@ -740,7 +741,7 @@ nprint: isprintable=0;
bboxValid=false;
calc_bbox();
#ifdef HAVE_FRIBIDI
- if (dir & FRIBIDI_MASK_RTL)
+ if (mustRealign)
realign(dirRight);
#endif
return 0;