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:
@@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "XUI_Ctrl_4JList.h"
|
||||
#include "..\..\..\Minecraft.World\ArabicShaping.h"
|
||||
|
||||
static bool TimeSortFn(const void *a, const void *b);
|
||||
|
||||
@@ -294,8 +295,16 @@ HRESULT CXuiCtrl4JList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceT
|
||||
if( ( 0 == pGetSourceTextData->iData ) && ( ( pGetSourceTextData->bItemData ) ) )
|
||||
{
|
||||
EnterCriticalSection(&m_AccessListData);
|
||||
pGetSourceTextData->szText =
|
||||
GetData(pGetSourceTextData->iItem).pwszText;
|
||||
LPCWSTR rawText = GetData(pGetSourceTextData->iItem).pwszText;
|
||||
if (rawText)
|
||||
{
|
||||
m_shapedTextCache = shapeArabicText(rawText);
|
||||
pGetSourceTextData->szText = m_shapedTextCache.c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
pGetSourceTextData->szText = rawText;
|
||||
}
|
||||
LeaveCriticalSection(&m_AccessListData);
|
||||
bHandled = TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user