mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCE-Revelations.git
synced 2026-09-23 19:20:54 +00:00
Add Arabic text shaping support for chat functionality
This commit introduces Arabic text shaping in the chat application by adding `ArabicShaping.cpp` and `ArabicShaping.h` for handling contextual forms and visual reordering. The rendering logic in `ChatScreen.cpp` is updated to utilize this new functionality, adjusting cursor positions accordingly. Other UI components, including `UIControl_Base.cpp`, `UIControl_Label.cpp`, and `UIControl_SaveList.cpp`, are modified to ensure proper display of Arabic text. Additionally, `Font.cpp` is enhanced with methods for efficient rendering of pre-shaped text.
This commit is contained in:
@@ -78,10 +78,14 @@ private:
|
||||
void renderUnicodeCharacter(wchar_t c);
|
||||
float unicodeCharWidth(wchar_t c);
|
||||
bool isUnicodeGlyphChar(wchar_t c);
|
||||
wstring sanitizePreshaped(const wstring& str); // sanitize without re-shaping Arabic
|
||||
void drawLiteralPreshaped(const wstring& str, int x, int y, int color);
|
||||
|
||||
public:
|
||||
int width(const wstring& str);
|
||||
int widthLiteral(const wstring& str); // width without skipping § codes (for chat input)
|
||||
int widthPreshaped(const wstring& str); // width of already-shaped text, no re-shaping
|
||||
void drawShadowLiteralPreshaped(const wstring& str, int x, int y, int color);
|
||||
wstring sanitize(const wstring& str);
|
||||
void drawWordWrap(const wstring &string, int x, int y, int w, int col, int h); // 4J Added h param
|
||||
|
||||
|
||||
Reference in New Issue
Block a user