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:
Revela
2026-03-17 17:08:58 -05:00
parent d473ef0dc5
commit e786604228
17 changed files with 717 additions and 28 deletions
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include <string>
// Shape Arabic text for visual display. Returns the visually-ordered string.
std::wstring shapeArabicText(const std::wstring& input);
// Same as above, but also maps a logical cursor position to its visual position
// in the returned string. Pass the logical cursor index; visualCursorPos receives
// the index into the returned string where the cursor should be drawn.
std::wstring shapeArabicText(const std::wstring& input, int logicalCursorPos, int* visualCursorPos);