Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I write in arabic (which i assume would be unicode) #5620

Closed
s4cta3l opened this issue Aug 29, 2022 · 3 comments
Closed

How can I write in arabic (which i assume would be unicode) #5620

s4cta3l opened this issue Aug 29, 2022 · 3 comments

Comments

@s4cta3l
Copy link

s4cta3l commented Aug 29, 2022

assume the correct way to go about this would be to push a font for it however I happen to be somewhat of a noobie so help would be appreciated.

this is the code that my research has yielded so far

`#include "includes.h"

#ifdef _WIN64
#define GWL_WNDPROC GWLP_WNDPROC
#endif

extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

EndScene oEndScene = NULL;
WNDPROC oWndProc;
static HWND window = NULL;

void InitImGui(LPDIRECT3DDEVICE9 pDevice)
{
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
ImGui_ImplWin32_Init(window);
ImGui_ImplDX9_Init(pDevice);

}

bool init = false;

bool show_main = false;

int screenX = GetSystemMetrics(SM_CXSCREEN);
int screenY = GetSystemMetrics(SM_CYSCREEN);

bool BHOP = false;

long __stdcall hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
if (!init)
{
InitImGui(pDevice);
init = true;
}
if (GetAsyncKeyState(VK_INSERT) & 1)
{
show_main = !show_main;
}
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();

if (show_main)
{
	
	ImGui::Begin("Please Help");
	ImGui::Checkbox("I have no idea what I'm doing :)", &BHOP);
    ImGui::End();
}
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());

return oEndScene(pDevice);

}

LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {

if (true && ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam))
	return true;

return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);

}

BOOL CALLBACK EnumWindowsCallback(HWND handle, LPARAM lParam)
{
DWORD wndProcId;
GetWindowThreadProcessId(handle, &wndProcId);

if (GetCurrentProcessId() != wndProcId)
	return TRUE; // skip to next window

window = handle;
return FALSE; // window found abort search

}

HWND GetProcessWindow()
{
window = NULL;
EnumWindows(EnumWindowsCallback, NULL);
return window;
}

DWORD WINAPI MainThread(LPVOID lpReserved)
{
bool attached = false;
do
{
if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success)
{
kiero::bind(42, (void**)& oEndScene, hkEndScene);
do
window = GetProcessWindow();
while (window == NULL);
oWndProc = (WNDPROC)SetWindowLongPtr(window, GWL_WNDPROC, (LONG_PTR)WndProc);
attached = true;
}
} while (!attached);
return TRUE;
}

BOOL WINAPI DllMain(HMODULE hMod, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hMod);
CreateThread(nullptr, 0, MainThread, hMod, 0, nullptr);
break;
case DLL_PROCESS_DETACH:
kiero::shutdown();
break;
}
return TRUE;
}
`

@s4cta3l
Copy link
Author

s4cta3l commented Aug 29, 2022

Sorry I'm new to writing on github

@ocornut
Copy link
Owner

ocornut commented Aug 29, 2022

Unfortunately this is not supported.
Also #1586.

Sorry I'm new to writing on github

Being new is fine but open an issue requests you to read and fill information and it's not nice to not do it.

@ocornut ocornut closed this as completed Aug 29, 2022
@rokups
Copy link
Contributor

rokups commented Aug 29, 2022

For future searches i suppose it is worth mentioning #4227, where someone showcased (but not provided) their implementation of rtl text rendering. If this feature is ever supported that issue will get notified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants