mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 09:18:38 +00:00
GRIM: use unicode-bidi for hebrew (#2917)
Co-authored-by: BLooperZ <blooperz@users.noreply.github.com>
This commit is contained in:
parent
77a166ad7e
commit
bc19f81d56
@ -20,6 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/unicode-bidi.h"
|
||||
#include "engines/grim/debug.h"
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/textobject.h"
|
||||
@ -278,16 +279,11 @@ void TextObject::setupText() {
|
||||
nextLinePos = message.size();
|
||||
cutLen = nextLinePos;
|
||||
}
|
||||
Common::String currentLine;
|
||||
Common::String currentLine(message.c_str(), message.c_str() + nextLinePos);
|
||||
|
||||
const char *start = message.c_str();
|
||||
// Reverse the line for the Hebrew translation
|
||||
if (g_grim->getGameLanguage() == Common::HE_ISR) {
|
||||
for (const char *ch = start + nextLinePos - 1; ch > start; --ch)
|
||||
currentLine += *ch;
|
||||
} else {
|
||||
currentLine = Common::String(start, start + nextLinePos);
|
||||
}
|
||||
if (g_grim->getGameLanguage() == Common::HE_ISR)
|
||||
currentLine = Common::convertBiDiString(currentLine, Common::kWindows1255);
|
||||
|
||||
_lines[j] = currentLine;
|
||||
int width = _font->getKernedStringLength(currentLine);
|
||||
|
Loading…
x
Reference in New Issue
Block a user