[Scummvm-git-logs] scummvm master -> 43fb70aa306078ebcbdbf85dc85af09de223dc23

bluegr noreply at scummvm.org
Sun May 19 21:07:58 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
43fb70aa30 ZVISION: Add BiDi text support


Commit: 43fb70aa306078ebcbdbf85dc85af09de223dc23
    https://github.com/scummvm/scummvm/commit/43fb70aa306078ebcbdbf85dc85af09de223dc23
Author: Niv Baehr (bloop93 at gmail.com)
Date: 2024-05-20T00:07:55+03:00

Commit Message:
ZVISION: Add BiDi text support

Changed paths:
    engines/zvision/text/truetype_font.cpp


diff --git a/engines/zvision/text/truetype_font.cpp b/engines/zvision/text/truetype_font.cpp
index 1b9156e4893..1f1cbd8786d 100644
--- a/engines/zvision/text/truetype_font.cpp
+++ b/engines/zvision/text/truetype_font.cpp
@@ -25,6 +25,7 @@
 #include "common/file.h"
 #include "common/system.h"
 #include "common/compression/unzip.h"
+#include "common/unicode-bidi.h"
 #include "common/ustr.h"
 #include "graphics/font.h"
 #include "graphics/fonts/ttf.h"
@@ -186,7 +187,7 @@ void StyledTTFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint
 void StyledTTFont::drawString(Graphics::Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, Graphics::TextAlign align) {
 	if (_font) {
 		Common::U32String u32str = Common::convertUtf8ToUtf32(str);
-		_font->drawString(dst, u32str, x, y, w, color, align);
+		_font->drawString(dst, Common::convertBiDiU32String(u32str).visual, x, y, w, color, align);
 		if (_style & TTF_STYLE_UNDERLINE) {
 			int16 pos = (int16)floor(_font->getFontHeight() * 0.87);
 			int16 wd = MIN(_font->getStringWidth(u32str), w);




More information about the Scummvm-git-logs mailing list